diff --git a/app.vue b/app.vue
index 70e5174e..2c9397b6 100644
--- a/app.vue
+++ b/app.vue
@@ -3,6 +3,8 @@
import Socket from "@/services/api/socket"
import amp from "@/services/amp"
import { watchForUpdate } from "@/services/version"
+import { DEFAULT_SETTINGS } from "@/services/constants/settings.js"
+import { isPrefersDarkScheme } from "@/services/utils"
/** Components */
import ModalsManager from "@/components/modals/ModalsManager.vue"
@@ -21,6 +23,7 @@ import { useSettingsStore } from "@/store/settings.store"
import { useEnumStore } from "@/store/enums.store"
import { useLegalStore } from "@/store/legal.store"
import { useNotificationsStore } from "@/store/notifications.store"
+
const nodeStore = useNodeStore()
const appStore = useAppStore()
const bookmarksStore = useBookmarksStore()
@@ -43,7 +46,47 @@ appStore.initConstants()
let watchInterval = null
+const settings = useCookie("localSettings", {
+ default: () => {
+ return DEFAULT_SETTINGS
+ },
+})
+
+switch (settings.value.appearance.general.theme) {
+ case "dark":
+ case "dimmed":
+ case "light":
+ appStore.theme = settings.value.appearance.general.theme
+
+ break
+
+ case "system":
+ appStore.theme = "system"
+
+ break
+}
+
+watch(() => settings.value.appearance.general.theme, () => {
+ let root = document.querySelector("html")
+
+ if (appStore.theme === "system") {
+ window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (event) => {
+ root.setAttribute("theme", isPrefersDarkScheme() ? "dark" : "light")
+ })
+ } else {
+ root.setAttribute("theme", settings.value.appearance.general.theme)
+ }
+}, { deep: true })
+
onMounted(async () => {
+ let root = document.querySelector("html")
+
+ if (appStore.theme === "system") {
+ root.setAttribute("theme", isPrefersDarkScheme() ? "dark" : "light")
+ } else {
+ root.setAttribute("theme", appStore.theme)
+ }
+
/**
* Watch for package.json->version and notify users about the new version
*/
@@ -92,7 +135,7 @@ onMounted(async () => {
settingsStore.init()
appStore.initGlobalUpdates()
-
+
const runtimeConfig = useRuntimeConfig()
amp.init(runtimeConfig.public.AMP)
@@ -132,7 +175,7 @@ onMounted(async () => {
})
}
- window.onbeforeunload = function () {
+ window.onbeforeunload = function() {
Socket.close()
}
})
diff --git a/components/ActionBar.vue b/components/ActionBar.vue
index e1c78678..d679b933 100644
--- a/components/ActionBar.vue
+++ b/components/ActionBar.vue
@@ -12,6 +12,7 @@ import { isMobile } from "@/services/utils"
/** Store */
import { useAppStore } from "@/store/app.store"
+
const appStore = useAppStore()
@@ -39,6 +40,7 @@ const appStore = useAppStore()
+
diff --git a/components/Auth.vue b/components/Auth.vue
new file mode 100644
index 00000000..3c535532
--- /dev/null
+++ b/components/Auth.vue
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+ Settings
+
+
+ Logout
+
+
+
+
+
+
+>
\ No newline at end of file
diff --git a/components/Connection.vue b/components/Connection.vue
index df3c0637..855bd551 100644
--- a/components/Connection.vue
+++ b/components/Connection.vue
@@ -12,6 +12,7 @@ import { arabica, mainnet, mocha } from "@/services/chains"
import { useAppStore } from "@/store/app.store"
import { useModalsStore } from "@/store/modals.store"
import { useNotificationsStore } from "@/store/notifications.store"
+
const appStore = useAppStore()
const modalsStore = useModalsStore()
const notificationsStore = useNotificationsStore()
@@ -80,7 +81,7 @@ const handleDisconnect = () => {
-
+