mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 19:28:12 +00:00
🐛 Fix issues with old profile theme data
This commit is contained in:
parent
9584e1b02d
commit
f1232fc461
@ -158,8 +158,17 @@
|
||||
(update [_ state]
|
||||
(update-in state [:profile :theme]
|
||||
(fn [current]
|
||||
(let [current (if (= current "system")
|
||||
(let [current (cond
|
||||
(= current "system")
|
||||
(theme/get-system-theme)
|
||||
|
||||
;; NOTE: this is a workaround for
|
||||
;; the old data on the database
|
||||
;; where whe have `default` value
|
||||
(= current "default")
|
||||
"dark"
|
||||
|
||||
:else
|
||||
current)]
|
||||
(case current
|
||||
"dark" "light"
|
||||
|
||||
@ -37,7 +37,11 @@
|
||||
[]
|
||||
(let [profile (mf/deref refs/profile)
|
||||
initial (mf/with-memo [profile]
|
||||
(update profile :lang #(or % "")))
|
||||
(-> profile
|
||||
(update :lang #(or % ""))
|
||||
(update :theme #(if (= % "default")
|
||||
"dark"
|
||||
%))))
|
||||
|
||||
form (fm/use-form :schema schema:options-form
|
||||
:initial initial)]
|
||||
|
||||
@ -44,5 +44,7 @@
|
||||
|
||||
(mf/with-effect [system-theme profile-theme]
|
||||
(set-color-scheme
|
||||
(if (= profile-theme "system") system-theme
|
||||
(d/nilv profile-theme "dark"))))))
|
||||
(cond
|
||||
(= profile-theme "system") system-theme
|
||||
(= profile-theme "default") "dark"
|
||||
:else (d/nilv profile-theme "dark"))))))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user