summaryrefslogtreecommitdiff
path: root/js/getTheme.ts
diff options
context:
space:
mode:
Diffstat (limited to 'js/getTheme.ts')
-rw-r--r--js/getTheme.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/js/getTheme.ts b/js/getTheme.ts
new file mode 100644
index 0000000..769ea3c
--- /dev/null
+++ b/js/getTheme.ts
@@ -0,0 +1,13 @@
+/// <reference path="setTheme.ts" />
+
+function getTheme(): Theme {
+ let theme = Theme.Dark;
+
+ try {
+ theme = JSON.parse(localStorage.getItem("theme")!);
+ } catch (e: any) {
+ console.log("invalid theme, using dark");
+ }
+
+ return theme;
+}