theme/style/palette seem to be working
This commit is contained in:
parent
a5b3840d06
commit
1f57fab6ae
10 changed files with 122 additions and 63 deletions
|
|
@ -209,7 +209,6 @@ export const useEmojiStore = defineStore('emoji', {
|
|||
)
|
||||
}
|
||||
|
||||
console.log('EMOJI', useInstanceStore().server)
|
||||
const emoji = Object.entries(values)
|
||||
.map(([key, value]) => {
|
||||
const imageUrl = value.image_url
|
||||
|
|
|
|||
|
|
@ -243,7 +243,8 @@ export const useInterfaceStore = defineStore('interface', {
|
|||
this.resetThemeV3Palette()
|
||||
this.resetThemeV2()
|
||||
|
||||
useSyncConfigStore().setPreference({ path: 'palette', value })
|
||||
useSyncConfigStore().setPreference({ path: 'simple.palette', value })
|
||||
useSyncConfigStore().pushSyncConfig()
|
||||
|
||||
this.applyTheme({ recompile: true })
|
||||
},
|
||||
|
|
@ -251,7 +252,11 @@ export const useInterfaceStore = defineStore('interface', {
|
|||
this.resetThemeV3Palette()
|
||||
this.resetThemeV2()
|
||||
|
||||
useSyncConfigStore().setPreference({ path: 'paletteCustomData', value })
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'simple.paletteCustomData',
|
||||
value,
|
||||
})
|
||||
useSyncConfigStore().pushSyncConfig()
|
||||
|
||||
this.applyTheme({ recompile: true })
|
||||
},
|
||||
|
|
@ -277,7 +282,8 @@ export const useInterfaceStore = defineStore('interface', {
|
|||
this.resetThemeV2()
|
||||
this.resetThemeV3Palette()
|
||||
|
||||
useSyncConfigStore().setPreference({ path: 'style', value })
|
||||
useSyncConfigStore().setPreference({ path: 'simple.style', value })
|
||||
useSyncConfigStore().pushSyncConfig()
|
||||
this.useStylePalette = true
|
||||
|
||||
this.applyTheme({ recompile: true }).then(() => {
|
||||
|
|
@ -289,7 +295,11 @@ export const useInterfaceStore = defineStore('interface', {
|
|||
this.resetThemeV2()
|
||||
this.resetThemeV3Palette()
|
||||
|
||||
useSyncConfigStore().setPreference({ path: 'styleCustomData', value })
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'simple.styleCustomData',
|
||||
value,
|
||||
})
|
||||
useSyncConfigStore().pushSyncConfig()
|
||||
|
||||
this.useStylePalette = true
|
||||
this.applyTheme({ recompile: true }).then(() => {
|
||||
|
|
@ -315,7 +325,8 @@ export const useInterfaceStore = defineStore('interface', {
|
|||
this.resetThemeV3Palette()
|
||||
this.resetThemeV2()
|
||||
|
||||
useSyncConfigStore().setPreference({ name: 'theme', value })
|
||||
useSyncConfigStore().setPreference({ path: 'simple.theme', value })
|
||||
useSyncConfigStore().pushSyncConfig()
|
||||
|
||||
this.applyTheme({ recompile: true })
|
||||
},
|
||||
|
|
@ -324,32 +335,45 @@ export const useInterfaceStore = defineStore('interface', {
|
|||
this.resetThemeV3Palette()
|
||||
this.resetThemeV2()
|
||||
|
||||
useSyncConfigStore().setPreference({ path: 'customTheme', value })
|
||||
useSyncConfigStore().setPreference({ path: 'customThemeSource', value })
|
||||
useSyncConfigStore().setPreference({ path: 'simple.customTheme', value })
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'simple.customThemeSource',
|
||||
value,
|
||||
})
|
||||
useSyncConfigStore().pushSyncConfig()
|
||||
|
||||
this.applyTheme({ recompile: true })
|
||||
},
|
||||
resetThemeV3() {
|
||||
useSyncConfigStore().setPreference({ path: 'style', value: null })
|
||||
useSyncConfigStore().setPreference({ path: 'simple.style', value: null })
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'styleCustomData',
|
||||
path: 'simple.styleCustomData',
|
||||
value: null,
|
||||
})
|
||||
useSyncConfigStore().pushSyncConfig()
|
||||
},
|
||||
resetThemeV3Palette() {
|
||||
useSyncConfigStore().setPreference({ path: 'palette', value: null })
|
||||
useSyncConfigStore().setPreference({
|
||||
name: 'paletteCustomData',
|
||||
path: 'simple.palette',
|
||||
value: null,
|
||||
})
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'simple.paletteCustomData',
|
||||
value: null,
|
||||
})
|
||||
useSyncConfigStore().pushSyncConfig()
|
||||
},
|
||||
resetThemeV2() {
|
||||
useSyncConfigStore().setPreference({ path: 'theme', value: null })
|
||||
useSyncConfigStore().setPreference({ path: 'customTheme', value: null })
|
||||
useSyncConfigStore().setPreference({ path: 'simple.theme', value: null })
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'customThemeSource',
|
||||
path: 'simple.customTheme',
|
||||
value: null,
|
||||
})
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'simple.customThemeSource',
|
||||
value: null,
|
||||
})
|
||||
useSyncConfigStore().pushSyncConfig()
|
||||
},
|
||||
async getThemeData() {
|
||||
const getData = async (resource, index, customData, name) => {
|
||||
|
|
@ -406,13 +430,13 @@ export const useInterfaceStore = defineStore('interface', {
|
|||
styleCustomData: userStyleCustomData,
|
||||
palette: userPaletteName,
|
||||
paletteCustomData: userPaletteCustomData,
|
||||
} = window.vuex.state.config
|
||||
} = useSyncConfigStore().mergedConfig
|
||||
|
||||
let {
|
||||
theme: userThemeV2Name,
|
||||
customTheme: userThemeV2Snapshot,
|
||||
customThemeSource: userThemeV2Source,
|
||||
} = window.vuex.state.config
|
||||
} = useSyncConfigStore().mergedConfig
|
||||
|
||||
let majorVersionUsed
|
||||
|
||||
|
|
@ -516,9 +540,10 @@ export const useInterfaceStore = defineStore('interface', {
|
|||
|
||||
if (this.useStylePalette) {
|
||||
useSyncConfigStore().setPreference({
|
||||
path: 'palette',
|
||||
path: 'path.palette',
|
||||
value: firstStylePaletteName,
|
||||
})
|
||||
useSyncConfigStore().pushSyncConfig()
|
||||
}
|
||||
|
||||
this.paletteNameUsed = palette.nameUsed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue