mirror of
https://github.com/penpot/penpot.git
synced 2025-01-21 22:22:43 -05:00
Fix renamed theme staying in active-themes
This commit is contained in:
parent
df8f67b5d3
commit
c75ab61732
1 changed files with 8 additions and 3 deletions
|
@ -487,16 +487,21 @@
|
||||||
(let [theme' (-> (make-token-theme (f theme))
|
(let [theme' (-> (make-token-theme (f theme))
|
||||||
(assoc :modified-at (dt/now)))
|
(assoc :modified-at (dt/now)))
|
||||||
group' (:group theme')
|
group' (:group theme')
|
||||||
name' (:name theme')]
|
name' (:name theme')
|
||||||
|
same-group? (= group group')
|
||||||
|
same-name? (= name name')
|
||||||
|
same-path? (and same-group? same-name?)]
|
||||||
(check-token-theme! theme')
|
(check-token-theme! theme')
|
||||||
(TokensLib. sets
|
(TokensLib. sets
|
||||||
set-groups
|
set-groups
|
||||||
(if (and (= group group') (= name name'))
|
(if same-path?
|
||||||
(update themes group' assoc name' theme')
|
(update themes group' assoc name' theme')
|
||||||
(-> themes
|
(-> themes
|
||||||
(d/oassoc-in-before [group name] [group' name'] theme')
|
(d/oassoc-in-before [group name] [group' name'] theme')
|
||||||
(d/dissoc-in [group name])))
|
(d/dissoc-in [group name])))
|
||||||
active-themes))
|
(if same-path?
|
||||||
|
active-themes
|
||||||
|
(disj active-themes (token-theme-path group name)))))
|
||||||
this)))
|
this)))
|
||||||
|
|
||||||
(delete-theme [_ group name]
|
(delete-theme [_ group name]
|
||||||
|
|
Loading…
Add table
Reference in a new issue