♻️ Cleanup code

This commit is contained in:
Xavier Julian 2026-01-08 10:32:47 +01:00
parent c8ee6ad04e
commit ea494753a1
2 changed files with 5 additions and 5 deletions

View File

@ -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."

View File

@ -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 %))