0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 08:50:57 -05:00

🐛 Fix deleted fonts present in recent block

This commit is contained in:
Alejandro Alonso 2023-07-03 08:07:46 +02:00 committed by Andrey Antukh
parent d939a86e75
commit 53cee87701

View file

@ -102,7 +102,10 @@
input (mf/use-ref)
fonts (mf/use-memo (mf/deps @state) #(filter-fonts @state @fonts/fonts))
recent-fonts (mf/deref refs/workspace-recent-fonts)
fontsdb (mf/deref fonts/fontsdb)
;; Filtering deleted fonts
recent-fonts (->> (mf/deref refs/workspace-recent-fonts)
(into [] (filter #(some? (get fontsdb (:id %))))))
select-next
(mf/use-callback
@ -259,7 +262,9 @@
fonts (mf/deref fonts/fontsdb)
font (get fonts font-id)
recent-fonts (mf/deref refs/workspace-recent-fonts)
;; Filtering deleted fonts
recent-fonts (->> (mf/deref refs/workspace-recent-fonts)
(into [] (filter #(some? (get fonts (:id %))))))
last-font (mf/use-ref nil)
open-selector? (mf/use-state false)