mirror of
https://github.com/penpot/penpot.git
synced 2025-03-12 07:41:43 -05:00
🐛 Fix recent fonts name changes
This commit is contained in:
parent
69f9982d26
commit
8963cb2739
2 changed files with 7 additions and 4 deletions
|
@ -318,9 +318,12 @@
|
|||
(swap! storage assoc ::recent-fonts most-recent-fonts)))))
|
||||
|
||||
(defn load-recent-fonts
|
||||
[]
|
||||
[fonts]
|
||||
(ptk/reify ::load-recent-fonts
|
||||
ptk/UpdateEvent
|
||||
(update [_ state]
|
||||
(let [saved-recent-fonts (::recent-fonts @storage)]
|
||||
(let [fonts-map (d/index-by :id fonts)
|
||||
saved-recent-fonts (->> (::recent-fonts @storage)
|
||||
(keep #(get fonts-map (:id %)))
|
||||
(into #{}))]
|
||||
(assoc-in state [:workspace-data :recent-fonts] saved-recent-fonts)))))
|
||||
|
|
|
@ -144,8 +144,8 @@
|
|||
(on-select font)
|
||||
(on-close)))]
|
||||
|
||||
(mf/with-effect []
|
||||
(st/emit! (fts/load-recent-fonts)))
|
||||
(mf/with-effect [fonts]
|
||||
(st/emit! (fts/load-recent-fonts fonts)))
|
||||
|
||||
(mf/with-effect [fonts]
|
||||
(let [key (events/listen js/document "keydown" on-key-down)]
|
||||
|
|
Loading…
Add table
Reference in a new issue