setOption pass 1
This commit is contained in:
parent
f62e0c5718
commit
6124d9c04c
12 changed files with 39 additions and 40 deletions
|
|
@ -74,7 +74,7 @@ export default {
|
|||
created() {
|
||||
// Load the locale from the storage
|
||||
const val = useSyncConfigStore().mergedConfig.interfaceLanguage
|
||||
this.$store.dispatch('setOption', { name: 'interfaceLanguage', value: val })
|
||||
useSyncConfigStore().setPreference({ path: 'simple.interfaceLanguage', value: val })
|
||||
document.getElementById('modal').classList = ['-' + this.layoutType]
|
||||
|
||||
// Create bound handlers
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ const ExtraNotifications = {
|
|||
return useInterfaceStore().openSettingsModalTab('notifications')
|
||||
},
|
||||
dismissConfigurationTip() {
|
||||
return this.$store.dispatch('setOption', {
|
||||
name: 'showExtraNotificationsTip',
|
||||
return useSyncConfigStore().setPreference({
|
||||
path: 'simple.showExtraNotificationsTip',
|
||||
value: false,
|
||||
})
|
||||
},
|
||||
|
|
|
|||
|
|
@ -124,8 +124,8 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
toggleNotificationFilter(type) {
|
||||
this.$store.dispatch('setOption', {
|
||||
name: 'notificationVisibility',
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'simple.notificationVisibility',
|
||||
value: {
|
||||
...this.filters,
|
||||
[type]: !this.filters[type],
|
||||
|
|
|
|||
|
|
@ -819,8 +819,8 @@ const PostStatusForm = {
|
|||
}
|
||||
},
|
||||
dismissScopeNotice() {
|
||||
this.$store.dispatch('setOption', {
|
||||
name: 'hideScopeNotice',
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'simple.hideScopeNotice',
|
||||
value: true,
|
||||
})
|
||||
},
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ const QuickFilterSettings = {
|
|||
},
|
||||
methods: {
|
||||
setReplyVisibility(visibility) {
|
||||
this.$store.dispatch('setOption', {
|
||||
name: 'replyVisibility',
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'simple.replyVisibility',
|
||||
value: visibility,
|
||||
})
|
||||
this.$store.dispatch('queueFlushAll')
|
||||
|
|
@ -87,9 +87,9 @@ const QuickFilterSettings = {
|
|||
},
|
||||
set() {
|
||||
const value = !this.hideMedia
|
||||
this.$store.dispatch('setOption', { name: 'hideAttachments', value })
|
||||
this.$store.dispatch('setOption', {
|
||||
name: 'hideAttachmentsInConv',
|
||||
useSyncConfigStore().setPreference({ path: 'simple.hideAttachments', value })
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'simple.hideAttachmentsInConv',
|
||||
value,
|
||||
})
|
||||
},
|
||||
|
|
@ -100,8 +100,8 @@ const QuickFilterSettings = {
|
|||
},
|
||||
set() {
|
||||
const value = !this.hideMutedPosts
|
||||
this.$store.dispatch('setOption', {
|
||||
name: 'hideFilteredStatuses',
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'simple.hideFilteredStatuses',
|
||||
value,
|
||||
})
|
||||
},
|
||||
|
|
@ -112,7 +112,7 @@ const QuickFilterSettings = {
|
|||
},
|
||||
set() {
|
||||
const value = !this.muteBotStatuses
|
||||
this.$store.dispatch('setOption', { name: 'muteBotStatuses', value })
|
||||
useSyncConfigStore().setPreference({ path: 'simple.muteBotStatuses', value })
|
||||
},
|
||||
},
|
||||
muteSensitiveStatuses: {
|
||||
|
|
@ -121,8 +121,8 @@ const QuickFilterSettings = {
|
|||
},
|
||||
set() {
|
||||
const value = !this.muteSensitiveStatuses
|
||||
this.$store.dispatch('setOption', {
|
||||
name: 'muteSensitiveStatuses',
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'simple.muteSensitiveStatuses',
|
||||
value,
|
||||
})
|
||||
},
|
||||
|
|
|
|||
|
|
@ -52,8 +52,8 @@ const ClutterTab = {
|
|||
if (value !== 'ask' && value !== 'forever') {
|
||||
realValue = '14d'
|
||||
}
|
||||
this.$store.dispatch('setOption', {
|
||||
name: 'onMuteDefaultAction',
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'simple.onMuteDefaultAction',
|
||||
value: realValue,
|
||||
})
|
||||
},
|
||||
|
|
@ -72,8 +72,8 @@ const ClutterTab = {
|
|||
if (value !== 'ask' && value !== 'forever') {
|
||||
realValue = '14d'
|
||||
}
|
||||
this.$store.dispatch('setOption', {
|
||||
name: 'onBlockDefaultAction',
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'simple.onBlockDefaultAction',
|
||||
value: realValue,
|
||||
})
|
||||
},
|
||||
|
|
|
|||
|
|
@ -120,8 +120,8 @@ const ComposingTab = {
|
|||
return useSyncConfigStore().mergedConfig.interfaceLanguage
|
||||
},
|
||||
set: function (val) {
|
||||
this.$store.dispatch('setOption', {
|
||||
name: 'interfaceLanguage',
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'simple.interfaceLanguage',
|
||||
value: val,
|
||||
})
|
||||
},
|
||||
|
|
@ -172,8 +172,8 @@ const ComposingTab = {
|
|||
})
|
||||
},
|
||||
updateFont(key, value) {
|
||||
this.$store.dispatch('setOption', {
|
||||
name: 'theme3hacks',
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'simple.theme3hacks',
|
||||
value: {
|
||||
...this.mergedConfig.theme3hacks,
|
||||
fonts: {
|
||||
|
|
|
|||
|
|
@ -112,8 +112,8 @@ const FilteringTab = {
|
|||
if (value !== 'ask' && value !== 'forever') {
|
||||
realValue = '14d'
|
||||
}
|
||||
this.$store.dispatch('setOption', {
|
||||
name: 'onMuteDefaultAction',
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'simple.onMuteDefaultAction',
|
||||
value: realValue,
|
||||
})
|
||||
},
|
||||
|
|
@ -132,8 +132,8 @@ const FilteringTab = {
|
|||
if (value !== 'ask' && value !== 'forever') {
|
||||
realValue = '14d'
|
||||
}
|
||||
this.$store.dispatch('setOption', {
|
||||
name: 'onBlockDefaultAction',
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'simple.onBlockDefaultAction',
|
||||
value: realValue,
|
||||
})
|
||||
},
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ import SharedComputedObject from '../helpers/shared_computed_object.js'
|
|||
import UnitSetting from '../helpers/unit_setting.vue'
|
||||
|
||||
import { useInstanceStore } from 'src/stores/instance.js'
|
||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||
import { useInstanceCapabilitiesStore } from 'src/stores/instance_capabilities.js'
|
||||
|
||||
import localeService from 'src/services/locale/locale.service.js'
|
||||
|
||||
|
|
@ -41,8 +41,8 @@ const GeneralTab = {
|
|||
return useSyncConfigStore().mergedConfig.interfaceLanguage
|
||||
},
|
||||
set: function (val) {
|
||||
this.$store.dispatch('setOption', {
|
||||
name: 'interfaceLanguage',
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'simple.interfaceLanguage',
|
||||
value: val,
|
||||
})
|
||||
},
|
||||
|
|
@ -69,8 +69,8 @@ const GeneralTab = {
|
|||
})
|
||||
},
|
||||
updateFont(key, value) {
|
||||
this.$store.dispatch('setOption', {
|
||||
name: 'theme3hacks',
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'simple.theme3hacks',
|
||||
value: {
|
||||
...this.mergedConfig.theme3hacks,
|
||||
fonts: {
|
||||
|
|
|
|||
|
|
@ -67,8 +67,8 @@ const GeneralTab = {
|
|||
},
|
||||
methods: {
|
||||
updateFont(key, value) {
|
||||
this.$store.dispatch('setOption', {
|
||||
name: 'theme3hacks',
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'simple.theme3hacks',
|
||||
value: {
|
||||
...this.mergedConfig.theme3hacks,
|
||||
fonts: {
|
||||
|
|
|
|||
|
|
@ -15,8 +15,7 @@ export const piniaLanguagePlugin = ({ store, options }) => {
|
|||
if (name === 'setPreference') {
|
||||
const { path, value } = args[0]
|
||||
if (path === 'simple.interfaceLanguage') {
|
||||
useI18nStore().setLanguage(value)
|
||||
messages.setLanguage(this.i18n, value)
|
||||
messages.setLanguage(useI18nStore().i18n, value)
|
||||
useEmojiStore().loadUnicodeEmojiData(value)
|
||||
Cookies.set(
|
||||
BACKEND_LANGUAGE_COOKIE_NAME,
|
||||
|
|
|
|||
|
|
@ -512,8 +512,8 @@ export const useInterfaceStore = defineStore('interface', {
|
|||
)
|
||||
|
||||
if (this.useStylePalette) {
|
||||
window.vuex.commit('setOption', {
|
||||
name: 'palette',
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'simple.palette',
|
||||
value: firstStylePaletteName,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue