mirror of
https://github.com/penpot/penpot.git
synced 2025-05-11 22:36:38 +02:00
🐛 Add filter to remove groups without content in all files
This commit is contained in:
parent
b50ffa087d
commit
42072f2584
7 changed files with 170 additions and 31 deletions
|
@ -8,6 +8,7 @@
|
|||
(:require
|
||||
[app.util.transit :as t]
|
||||
[app.util.timers :as tm]
|
||||
[app.util.globals :as g]
|
||||
[app.common.exceptions :as ex]))
|
||||
|
||||
(defn- ^boolean is-worker?
|
||||
|
@ -36,17 +37,18 @@
|
|||
|
||||
(defn- load
|
||||
[storage]
|
||||
(let [len (.-length ^js storage)]
|
||||
(reduce (fn [res index]
|
||||
(let [key (.key ^js storage index)
|
||||
val (.getItem ^js storage key)]
|
||||
(try
|
||||
(assoc res (t/decode key) (t/decode val))
|
||||
(catch :default e
|
||||
res))))
|
||||
{}
|
||||
(range len))))
|
||||
(when storage
|
||||
(let [len (.-length ^js storage)]
|
||||
(reduce (fn [res index]
|
||||
(let [key (.key ^js storage index)
|
||||
val (.getItem ^js storage key)]
|
||||
(try
|
||||
(assoc res (t/decode key) (t/decode val))
|
||||
(catch :default e
|
||||
res))))
|
||||
{}
|
||||
(range len)))))
|
||||
|
||||
|
||||
(defonce storage (atom (load js/localStorage)))
|
||||
(defonce storage (atom (load (unchecked-get g/global "localStorage"))))
|
||||
(add-watch storage :persistence #(persist js/localStorage %3 %4))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue