Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85951181
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
5 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/components/settings_modal/tabs/appearance_tab.js b/src/components/settings_modal/tabs/appearance_tab.js
index 9325f5f21c..7983672350 100644
--- a/src/components/settings_modal/tabs/appearance_tab.js
+++ b/src/components/settings_modal/tabs/appearance_tab.js
@@ -317,7 +317,7 @@ const AppearanceTab = {
isStyleDefined() {
if (this.defaultSource === 'local') {
return Object.hasOwn(useLocalConfigStore().mergedConfig, 'style')
- } else if (this.defaultSource === 'admin') {
+ } else if (this.defaultSource === 'fe-admin') {
return Object.hasOwn(useAdminSettingsStore().frontendConfig ?? {}, 'style')
} else {
return true
@@ -326,7 +326,7 @@ const AppearanceTab = {
isPaletteDefined() {
if (this.defaultSource === 'local') {
return Object.hasOwn(useLocalConfigStore().mergedConfig, 'palette')
- } else if (this.defaultSource === 'admin') {
+ } else if (this.defaultSource === 'fe-admin') {
return Object.hasOwn(useAdminSettingsStore().frontendConfig ?? {}, 'palette')
} else {
return true
@@ -364,6 +364,7 @@ const AppearanceTab = {
const ruleset = style || []
if (ruleset.length === 0) {
this.palettesLoaded = true
+ return
}
const meta = ruleset.find((x) => x.component === '@meta')
const result = ruleset
@@ -445,7 +446,9 @@ const AppearanceTab = {
},
unsetStyle() {
useInterfaceStore().resetThemeV3(this.defaultSource)
+ useInterfaceStore().resetThemeV3Palette(this.defaultSource)
useInterfaceStore().resetThemeV2(this.defaultSource)
+ useInterfaceStore().pushPreferences({ store: this.defaultSource })
},
setTheme(name) {
useInterfaceStore().setTheme(name, this.defaultSource)
@@ -460,6 +463,7 @@ const AppearanceTab = {
},
unsetPalette() {
useInterfaceStore().resetThemeV3Palette(this.defaultSource)
+ useInterfaceStore().pushPreferences({ store: this.defaultSource })
},
previewTheme(key, version, input) {
let theme3
diff --git a/src/stores/admin_settings.js b/src/stores/admin_settings.js
index ee3a5d5383..4292b271ee 100644
--- a/src/stores/admin_settings.js
+++ b/src/stores/admin_settings.js
@@ -287,7 +287,7 @@ export const useAdminSettingsStore = defineStore('adminSettings', {
}
}
- pushInstanceDBConfig({
+ return pushInstanceDBConfig({
credentials: useOAuthStore().token,
payload: {
configs: [
diff --git a/src/stores/interface.js b/src/stores/interface.js
index cdd93e964b..e3994f4150 100644
--- a/src/stores/interface.js
+++ b/src/stores/interface.js
@@ -65,6 +65,7 @@ export const useInterfaceStore = defineStore('interface', {
paletteDataUsed: null,
themeNameUsed: null,
themeDataUsed: null,
+ adminFrontendConfig: null,
temporaryChangesTimeoutId: null,
temporaryChangesCountdown: -1, // used for temporary options that revert after a timeout
temporaryChangesConfirm: () => {
@@ -372,21 +373,10 @@ export const useInterfaceStore = defineStore('interface', {
return useLocalConfigStore().set({ path, value })
// Copypasta from setting.js
case 'fe-admin': {
- const prefix = [
- ':pleroma',
- ':frontend_configurations',
- ':pleroma_fe',
- ]
- const settings = cloneDeep(useAdminSettingsStore().frontendConfig)
- set(settings, path, value)
- const formatted = Object.fromEntries(
- Object.entries(settings).map(([k, v]) => [`:${k}`, v]),
- )
-
- return useAdminSettingsStore().pushAdminSetting({
- path: prefix.join('.'),
- value: formatted,
- })
+ if (this.adminFrontendConfig === null) {
+ this.adminFrontendConfig = cloneDeep(useAdminSettingsStore().frontendConfig)
+ }
+ set(this.adminFrontendConfig, path, value)
}
}
},
@@ -398,27 +388,31 @@ export const useInterfaceStore = defineStore('interface', {
return useLocalConfigStore().unset({ path, value })
// Copypasta from setting.js
case 'fe-admin': {
- const prefix = [
- ':pleroma',
- ':frontend_configurations',
- ':pleroma_fe',
- ]
- const settings = cloneDeep(useAdminSettingsStore().frontendConfig)
- unset(settings, path)
- const formatted = Object.fromEntries(
- Object.entries(settings).map(([k, v]) => [`:${k}`, v]),
- )
-
- return useAdminSettingsStore().pushAdminSetting({
- path: prefix.join('.'),
- value: formatted,
- })
+ if (this.adminFrontendConfig === null) {
+ this.adminFrontendConfig = cloneDeep(useAdminSettingsStore().frontendConfig)
+ }
+ unset(this.adminFrontendConfig, path)
}
}
},
async pushPreferences({ store }) {
if (store === 'sync') {
return useSyncConfigStore().pushSyncConfig()
+ } else if (store === 'fe-admin') {
+ const path = [
+ ':pleroma',
+ ':frontend_configurations',
+ ':pleroma_fe',
+ ].join('.')
+ const value = Object.fromEntries(
+ Object.entries(this.adminFrontendConfig).map(([k, v]) => [`:${k}`, v]),
+ )
+ return useAdminSettingsStore().pushAdminSetting({
+ path,
+ value,
+ }).then(() => {
+ this.adminFrontendConfig = cloneDeep(useAdminSettingsStore().frontendConfig)
+ })
} else {
return
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Thu, Nov 19, 8:25 AM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1841061
Default Alt Text
(5 KB)
Attached To
Mode
rPUFE pleroma-fe-upstream
Attached
Detach File
Event Timeline