0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-11 23:31:21 -05:00

🐛 Fix problem renaming boards from viewport

This commit is contained in:
alonso.torres 2024-04-09 12:07:17 +02:00
parent 8f0e11d020
commit f6c6207522
2 changed files with 7 additions and 7 deletions

View file

@ -682,12 +682,12 @@
(defn end-rename-shape
"End the ongoing shape rename process"
([] (end-rename-shape nil))
([name]
([] (end-rename-shape nil nil))
([shape-id name]
(ptk/reify ::end-rename-shape
ptk/WatchEvent
(watch [_ state _]
(when-let [shape-id (dm/get-in state [:workspace-local :shape-for-rename])]
(when-let [shape-id (d/nilv shape-id (dm/get-in state [:workspace-local :shape-for-rename]))]
(let [shape (wsh/lookup-shape state shape-id)
name (str/trim name)
clean-name (cfh/clean-path name)

View file

@ -51,21 +51,21 @@
accept-edit
(mf/use-fn
(mf/deps on-stop-edit)
(mf/deps shape-id on-stop-edit)
(fn []
(let [name-input (mf/ref-val ref)
name (str/trim (dom/get-value name-input))]
(on-stop-edit)
(reset! edition* false)
(st/emit! (dw/end-rename-shape name)))))
(st/emit! (dw/end-rename-shape shape-id name)))))
cancel-edit
(mf/use-fn
(mf/deps on-stop-edit)
(mf/deps shape-id on-stop-edit)
(fn []
(on-stop-edit)
(reset! edition* false)
(st/emit! (dw/end-rename-shape nil))))
(st/emit! (dw/end-rename-shape shape-id nil))))
on-key-down
(mf/use-fn