massive rename and separation merged config into its own "store"
This commit is contained in:
parent
1be0debc63
commit
4e235562aa
65 changed files with 272 additions and 221 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import Checkbox from 'src/components/checkbox/checkbox.vue'
|
||||
import Setting from './setting.js'
|
||||
|
||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||
|
||||
export default {
|
||||
...Setting,
|
||||
|
|
@ -45,7 +45,7 @@ export default {
|
|||
if (this.forceNew) return true
|
||||
if (!this.allowNew) return false
|
||||
|
||||
const isExpert = useSyncConfigStore().mergedConfig.expertLevel > 0
|
||||
const isExpert = useMergedConfigStore().mergedConfig.expertLevel > 0
|
||||
const hasBuiltins = this.builtinEntries.length > 0
|
||||
|
||||
if (hasBuiltins) {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import ModifiedIndicator from './modified_indicator.vue'
|
|||
import { useInstanceStore } from 'src/stores/instance.js'
|
||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||
import { useLocalConfigStore } from 'src/stores/local_config.js'
|
||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||
|
||||
export default {
|
||||
|
|
@ -244,7 +245,7 @@ export default {
|
|||
case 'admin':
|
||||
return this.$store.state.adminSettings.config
|
||||
default:
|
||||
return useSyncConfigStore().mergedConfig
|
||||
return useMergedConfigStore().mergedConfig
|
||||
}
|
||||
},
|
||||
configSink() {
|
||||
|
|
@ -323,7 +324,7 @@ export default {
|
|||
case 'profile':
|
||||
return {}
|
||||
default: {
|
||||
return get(useSyncConfigStore().mergedConfigDefault, this.path)
|
||||
return get(useMergedConfigStore().mergedConfigDefault, this.path)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -379,7 +380,7 @@ export default {
|
|||
matchesExpertLevel() {
|
||||
const settingExpertLevel = this.expert || 0
|
||||
const userToggleExpert =
|
||||
useSyncConfigStore().mergedConfig.expertLevel || 0
|
||||
useMergedConfigStore().mergedConfig.expertLevel || 0
|
||||
|
||||
return settingExpertLevel <= userToggleExpert
|
||||
},
|
||||
|
|
@ -405,7 +406,7 @@ export default {
|
|||
this.draft = cloneDeep(this.state)
|
||||
} else {
|
||||
set(
|
||||
useSyncConfigStore().mergedConfig,
|
||||
useMergedConfigStore().mergedConfig,
|
||||
this.path,
|
||||
cloneDeep(this.defaultState),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { mapState as mapPiniaState } from 'pinia'
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||
|
||||
const SharedComputedObject = () => ({
|
||||
...mapPiniaState(useSyncConfigStore, ['mergedConfig']),
|
||||
...mapPiniaState(useSyncConfigStore, {
|
||||
...mapPiniaState(useMergedConfigStore, ['mergedConfig']),
|
||||
...mapPiniaState(useMergedConfigStore, {
|
||||
expertLevel: (store) => store.mergedConfig.expertLevel,
|
||||
}),
|
||||
...mapState({
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import SecurityTab from './tabs/security_tab/security_tab.vue'
|
|||
import StyleTab from './tabs/style_tab/style_tab.vue'
|
||||
|
||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||
|
||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||
import {
|
||||
|
|
@ -84,7 +84,7 @@ const SettingsModalContent = {
|
|||
return useInterfaceStore().settingsModalState === 'visible'
|
||||
},
|
||||
expertLevel() {
|
||||
return useSyncConfigStore().mergedConfig.expertLevel
|
||||
return useMergedConfigStore().mergedConfig.expertLevel
|
||||
},
|
||||
},
|
||||
data() {
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import UnitSetting from '../helpers/unit_setting.vue'
|
|||
|
||||
import { useInstanceStore } from 'src/stores/instance.js'
|
||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||
|
||||
import localeService from 'src/services/locale/locale.service.js'
|
||||
|
|
@ -116,7 +117,7 @@ const ComposingTab = {
|
|||
},
|
||||
language: {
|
||||
get: function () {
|
||||
return useSyncConfigStore().mergedConfig.interfaceLanguage
|
||||
return useMergedConfigStore().mergedConfig.interfaceLanguage
|
||||
},
|
||||
set: function (val) {
|
||||
useSyncConfigStore().setSimplePrefAndSave({
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import UnitSetting from '../helpers/unit_setting.vue'
|
|||
|
||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||
import { useInterfaceStore } from 'src/stores/interface'
|
||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||
|
||||
import {
|
||||
|
|
@ -36,7 +37,7 @@ const FilteringTab = {
|
|||
label: this.$t(`user_card.mute_block_${mode}`),
|
||||
})),
|
||||
muteFiltersDraftObject: cloneDeep(
|
||||
useSyncConfigStore().mergedConfig.muteFilters,
|
||||
useMergedConfigStore().mergedConfig.muteFilters,
|
||||
),
|
||||
muteFiltersDraftDirty: Object.fromEntries(
|
||||
Object.entries(
|
||||
|
|
@ -100,7 +101,7 @@ const FilteringTab = {
|
|||
...mapState(useInstanceCapabilitiesStore, ['blockExpiration']),
|
||||
onMuteDefaultActionLv1: {
|
||||
get() {
|
||||
const value = useSyncConfigStore().mergedConfig.onMuteDefaultAction
|
||||
const value = useMergedConfigStore().mergedConfig.onMuteDefaultAction
|
||||
if (value === 'ask' || value === 'forever') {
|
||||
return value
|
||||
} else {
|
||||
|
|
@ -120,7 +121,7 @@ const FilteringTab = {
|
|||
},
|
||||
onBlockDefaultActionLv1: {
|
||||
get() {
|
||||
const value = useSyncConfigStore().mergedConfig.onBlockDefaultAction
|
||||
const value = useMergedConfigStore().mergedConfig.onBlockDefaultAction
|
||||
if (value === 'ask' || value === 'forever') {
|
||||
return value
|
||||
} else {
|
||||
|
|
@ -263,7 +264,7 @@ const FilteringTab = {
|
|||
},
|
||||
muteFiltersObject() {
|
||||
this.muteFiltersDraftObject = cloneDeep(
|
||||
useSyncConfigStore().mergedConfig.muteFilters,
|
||||
useMergedConfigStore().mergedConfig.muteFilters,
|
||||
)
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import UnitSetting from '../helpers/unit_setting.vue'
|
|||
import { useInstanceStore } from 'src/stores/instance.js'
|
||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||
import { useLocalConfigStore } from 'src/stores/local_config.js'
|
||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||
|
||||
import localeService from 'src/services/locale/locale.service.js'
|
||||
|
|
@ -37,7 +38,7 @@ const GeneralTab = {
|
|||
computed: {
|
||||
language: {
|
||||
get: function () {
|
||||
return useSyncConfigStore().mergedConfig.interfaceLanguage
|
||||
return useMergedConfigStore().mergedConfig.interfaceLanguage
|
||||
},
|
||||
set: function (val) {
|
||||
useSyncConfigStore().setSimplePrefAndSave({
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import SharedComputedObject from '../helpers/shared_computed_object.js'
|
|||
import UnitSetting from '../helpers/unit_setting.vue'
|
||||
|
||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||
|
||||
const GeneralTab = {
|
||||
data() {
|
||||
|
|
@ -31,12 +31,12 @@ const GeneralTab = {
|
|||
'suggestionsEnabled',
|
||||
]),
|
||||
columns() {
|
||||
const mode = useSyncConfigStore().mergedConfig.thirdColumnMode
|
||||
const mode = useMergedConfigStore().mergedConfig.thirdColumnMode
|
||||
|
||||
const notif = mode === 'none' ? [] : ['notifs']
|
||||
|
||||
if (
|
||||
useSyncConfigStore().mergedConfig.sidebarRight ||
|
||||
useMergedConfigStore().mergedConfig.sidebarRight ||
|
||||
mode === 'postform'
|
||||
) {
|
||||
return [...notif, 'content', 'sidebar']
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import Preview from './theme_preview.vue'
|
|||
|
||||
import { useInstanceStore } from 'src/stores/instance.js'
|
||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||
|
||||
import {
|
||||
getContrastRatioLayers,
|
||||
|
|
@ -82,7 +82,7 @@ export default {
|
|||
}),
|
||||
availableStyles: [],
|
||||
selected: '',
|
||||
selectedTheme: useSyncConfigStore().mergedConfig.theme,
|
||||
selectedTheme: useMergedConfigStore().mergedConfig.theme,
|
||||
themeWarning: undefined,
|
||||
tempImportFile: undefined,
|
||||
engineVersion: 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue