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