mirror of
https://github.com/penpot/penpot.git
synced 2026-09-12 06:58:57 +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 [_ state]
|
||||||
(update-in state [:profile :theme]
|
(update-in state [:profile :theme]
|
||||||
(fn [current]
|
(fn [current]
|
||||||
(let [current (if (= current "system")
|
(let [current (cond
|
||||||
|
(= current "system")
|
||||||
(theme/get-system-theme)
|
(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)]
|
current)]
|
||||||
(case current
|
(case current
|
||||||
"dark" "light"
|
"dark" "light"
|
||||||
|
|||||||
@ -37,7 +37,11 @@
|
|||||||
[]
|
[]
|
||||||
(let [profile (mf/deref refs/profile)
|
(let [profile (mf/deref refs/profile)
|
||||||
initial (mf/with-memo [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
|
form (fm/use-form :schema schema:options-form
|
||||||
:initial initial)]
|
:initial initial)]
|
||||||
|
|||||||
@ -44,5 +44,7 @@
|
|||||||
|
|
||||||
(mf/with-effect [system-theme profile-theme]
|
(mf/with-effect [system-theme profile-theme]
|
||||||
(set-color-scheme
|
(set-color-scheme
|
||||||
(if (= profile-theme "system") system-theme
|
(cond
|
||||||
(d/nilv profile-theme "dark"))))))
|
(= profile-theme "system") system-theme
|
||||||
|
(= profile-theme "default") "dark"
|
||||||
|
:else (d/nilv profile-theme "dark"))))))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user