mirror of https://github.com/penpot/penpot.git
♻️ Cleanup code
This commit is contained in:
parent
c8ee6ad04e
commit
ea494753a1
|
|
@ -99,11 +99,11 @@ Some naming conventions:
|
|||
|
||||
(defn butlast-path
|
||||
"Remove the last item of the path."
|
||||
[path separator]
|
||||
(let [split (split-path path :separator separator)]
|
||||
[path]
|
||||
(let [split (split-path path)]
|
||||
(if (= 1 (count split))
|
||||
""
|
||||
(join-path (butlast split) :separator separator))))
|
||||
(join-path (butlast split)))))
|
||||
|
||||
(defn butlast-path-with-dots
|
||||
"Remove the last item of the path."
|
||||
|
|
|
|||
|
|
@ -716,7 +716,7 @@
|
|||
(remove str/empty?)
|
||||
(remove nil?)
|
||||
(distinct)
|
||||
(filter #(= (cpn/butlast-path % "/") (:path filters))))
|
||||
(filter #(= (cpn/butlast-path %) (:path filters))))
|
||||
|
||||
groups (when-not search?
|
||||
(->> (sort (sequence xform components))
|
||||
|
|
@ -762,7 +762,7 @@
|
|||
on-go-back
|
||||
(mf/use-fn
|
||||
(mf/deps (:path filters))
|
||||
#(swap! filters* assoc :path (cpn/butlast-path (:path filters) "/")))
|
||||
#(swap! filters* assoc :path (cpn/butlast-path (:path filters))))
|
||||
|
||||
on-enter-group
|
||||
(mf/use-fn #(swap! filters* assoc :path %))
|
||||
|
|
|
|||
Loading…
Reference in New Issue