Compare commits
No commits in common. "209637ee8a875032d4a8754b38010b1afdbaddbb" and "6d6c627c3e7e6f7bda3d2bbd9e5bc5040f347324" have entirely different histories.
209637ee8a
...
6d6c627c3e
4 changed files with 14 additions and 27 deletions
10
src/App.js
10
src/App.js
|
|
@ -2,8 +2,6 @@ import { throttle } from 'lodash'
|
||||||
import { mapState } from 'pinia'
|
import { mapState } from 'pinia'
|
||||||
import { defineAsyncComponent } from 'vue'
|
import { defineAsyncComponent } from 'vue'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import messages from 'src/i18n/messages'
|
|
||||||
import localeService from 'src/services/locale/locale.service.js'
|
|
||||||
|
|
||||||
import DesktopNav from './components/desktop_nav/desktop_nav.vue'
|
import DesktopNav from './components/desktop_nav/desktop_nav.vue'
|
||||||
import EditStatusModal from './components/edit_status_modal/edit_status_modal.vue'
|
import EditStatusModal from './components/edit_status_modal/edit_status_modal.vue'
|
||||||
|
|
@ -24,8 +22,6 @@ import WhoToFollowPanel from './components/who_to_follow_panel/who_to_follow_pan
|
||||||
import { getOrCreateServiceWorker } from './services/sw/sw'
|
import { getOrCreateServiceWorker } from './services/sw/sw'
|
||||||
import { windowHeight, windowWidth } from './services/window_utils/window_utils'
|
import { windowHeight, windowWidth } from './services/window_utils/window_utils'
|
||||||
|
|
||||||
import { useI18nStore } from 'src/stores/i18n.js'
|
|
||||||
import { useEmojiStore } from 'src/stores/emoji.js'
|
|
||||||
import { useInstanceStore } from 'src/stores/instance.js'
|
import { useInstanceStore } from 'src/stores/instance.js'
|
||||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
|
|
@ -77,10 +73,8 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
// Load the locale from the storage
|
// Load the locale from the storage
|
||||||
const value = useSyncConfigStore().mergedConfig.interfaceLanguage
|
const val = useSyncConfigStore().mergedConfig.interfaceLanguage
|
||||||
useI18nStore().setLanguage(value)
|
useSyncConfigStore().setSimplePrefAndSave({ path: 'interfaceLanguage', value: val })
|
||||||
useEmojiStore().loadUnicodeEmojiData(value)
|
|
||||||
|
|
||||||
document.getElementById('modal').classList = ['-' + this.layoutType]
|
document.getElementById('modal').classList = ['-' + this.layoutType]
|
||||||
|
|
||||||
// Create bound handlers
|
// Create bound handlers
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,12 @@ import Cookies from 'js-cookie'
|
||||||
|
|
||||||
import { useEmojiStore } from 'src/stores/emoji.js'
|
import { useEmojiStore } from 'src/stores/emoji.js'
|
||||||
import { useI18nStore } from 'src/stores/i18n.js'
|
import { useI18nStore } from 'src/stores/i18n.js'
|
||||||
|
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||||
|
|
||||||
|
import messages from 'src/i18n/messages'
|
||||||
|
import localeService from 'src/services/locale/locale.service.js'
|
||||||
|
|
||||||
|
const BACKEND_LANGUAGE_COOKIE_NAME = 'userLanguage'
|
||||||
|
|
||||||
export const piniaLanguagePlugin = ({ store, options }) => {
|
export const piniaLanguagePlugin = ({ store, options }) => {
|
||||||
if (store.$id === 'sync_config') {
|
if (store.$id === 'sync_config') {
|
||||||
|
|
@ -9,8 +15,12 @@ export const piniaLanguagePlugin = ({ store, options }) => {
|
||||||
if (name === 'setPreference') {
|
if (name === 'setPreference') {
|
||||||
const { path, value } = args[0]
|
const { path, value } = args[0]
|
||||||
if (path === 'simple.interfaceLanguage') {
|
if (path === 'simple.interfaceLanguage') {
|
||||||
useI18nStore().setLanguage(value)
|
messages.setLanguage(useI18nStore().i18n, value)
|
||||||
useEmojiStore().loadUnicodeEmojiData(value)
|
useEmojiStore().loadUnicodeEmojiData(value)
|
||||||
|
Cookies.set(
|
||||||
|
BACKEND_LANGUAGE_COOKIE_NAME,
|
||||||
|
localeService.internalToBackendLocaleMulti(value),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,6 @@
|
||||||
import Cookies from 'js-cookie'
|
import Cookies from 'js-cookie'
|
||||||
import messages from 'src/i18n/messages'
|
|
||||||
import localeService from 'src/services/locale/locale.service.js'
|
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
|
|
||||||
const BACKEND_LANGUAGE_COOKIE_NAME = 'userLanguage'
|
|
||||||
|
|
||||||
export const useI18nStore = defineStore('i18n', {
|
export const useI18nStore = defineStore('i18n', {
|
||||||
state: () => ({
|
state: () => ({
|
||||||
i18n: null,
|
i18n: null,
|
||||||
|
|
@ -15,12 +11,5 @@ export const useI18nStore = defineStore('i18n', {
|
||||||
i18n: newI18n.global,
|
i18n: newI18n.global,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
setLanguage(value) {
|
|
||||||
messages.setLanguage(this.i18n, value)
|
|
||||||
Cookies.set(
|
|
||||||
BACKEND_LANGUAGE_COOKIE_NAME,
|
|
||||||
localeService.internalToBackendLocaleMulti(value),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -605,15 +605,9 @@ export const useSyncConfigStore = defineStore('sync_config', {
|
||||||
)
|
)
|
||||||
cache = null
|
cache = null
|
||||||
}
|
}
|
||||||
|
console.log(cache, live)
|
||||||
|
|
||||||
console.log('======')
|
|
||||||
console.log('CACHE', cache.prefsStorage.simple.conversationDisplay)
|
|
||||||
console.log('LIVE', live.prefsStorage.simple.conversationDisplay)
|
|
||||||
let { recent, stale, needUpload } = _getRecentData(cache, live)
|
let { recent, stale, needUpload } = _getRecentData(cache, live)
|
||||||
console.log('======')
|
|
||||||
console.log('RECENT', cache.prefsStorage.simple.conversationDisplay)
|
|
||||||
console.log('STALE', live.prefsStorage.simple.conversationDisplay)
|
|
||||||
console.log('======')
|
|
||||||
|
|
||||||
const userNew = userData.created_at > NEW_USER_DATE
|
const userNew = userData.created_at > NEW_USER_DATE
|
||||||
const flagsTemplate = userNew ? newUserFlags : defaultState.flagStorage
|
const flagsTemplate = userNew ? newUserFlags : defaultState.flagStorage
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue