feat: theme syncing
This commit is contained in:
@@ -3,7 +3,14 @@
|
||||
import clone from "lodash/clone"
|
||||
import assign from "lodash/assign"
|
||||
import eq from "lodash/eq"
|
||||
import { settingsStore, bulkApplySettings, defaultSettings } from "./settings"
|
||||
import {
|
||||
settingsStore,
|
||||
bulkApplySettings,
|
||||
defaultSettings,
|
||||
applySetting,
|
||||
HoppAccentColor,
|
||||
HoppBgColor,
|
||||
} from "./settings"
|
||||
import {
|
||||
restHistoryStore,
|
||||
graphqlHistoryStore,
|
||||
@@ -55,6 +62,20 @@ function checkAndMigrateOldSettings() {
|
||||
delete vuexData.postwoman.environments
|
||||
window.localStorage.setItem("vuex", JSON.stringify(vuexData))
|
||||
}
|
||||
|
||||
if (window.localStorage.getItem("THEME_COLOR")) {
|
||||
const themeColor = window.localStorage.getItem("THEME_COLOR")
|
||||
applySetting("THEME_COLOR", themeColor as HoppAccentColor)
|
||||
|
||||
window.localStorage.removeItem("THEME_COLOR")
|
||||
}
|
||||
|
||||
if (window.localStorage.getItem("nuxt-color-mode")) {
|
||||
const color = window.localStorage.getItem("nuxt-color-mode") as HoppBgColor
|
||||
applySetting("BG_COLOR", color)
|
||||
|
||||
window.localStorage.removeItem("BG_COLOR")
|
||||
}
|
||||
}
|
||||
|
||||
function setupSettingsPersistence() {
|
||||
|
||||
Reference in New Issue
Block a user