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:
parent
8f0e11d020
commit
f6c6207522
2 changed files with 7 additions and 7 deletions
|
@ -682,12 +682,12 @@
|
||||||
|
|
||||||
(defn end-rename-shape
|
(defn end-rename-shape
|
||||||
"End the ongoing shape rename process"
|
"End the ongoing shape rename process"
|
||||||
([] (end-rename-shape nil))
|
([] (end-rename-shape nil nil))
|
||||||
([name]
|
([shape-id name]
|
||||||
(ptk/reify ::end-rename-shape
|
(ptk/reify ::end-rename-shape
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ state _]
|
(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)
|
(let [shape (wsh/lookup-shape state shape-id)
|
||||||
name (str/trim name)
|
name (str/trim name)
|
||||||
clean-name (cfh/clean-path name)
|
clean-name (cfh/clean-path name)
|
||||||
|
|
|
@ -51,21 +51,21 @@
|
||||||
|
|
||||||
accept-edit
|
accept-edit
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps on-stop-edit)
|
(mf/deps shape-id on-stop-edit)
|
||||||
(fn []
|
(fn []
|
||||||
(let [name-input (mf/ref-val ref)
|
(let [name-input (mf/ref-val ref)
|
||||||
name (str/trim (dom/get-value name-input))]
|
name (str/trim (dom/get-value name-input))]
|
||||||
(on-stop-edit)
|
(on-stop-edit)
|
||||||
(reset! edition* false)
|
(reset! edition* false)
|
||||||
(st/emit! (dw/end-rename-shape name)))))
|
(st/emit! (dw/end-rename-shape shape-id name)))))
|
||||||
|
|
||||||
cancel-edit
|
cancel-edit
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps on-stop-edit)
|
(mf/deps shape-id on-stop-edit)
|
||||||
(fn []
|
(fn []
|
||||||
(on-stop-edit)
|
(on-stop-edit)
|
||||||
(reset! edition* false)
|
(reset! edition* false)
|
||||||
(st/emit! (dw/end-rename-shape nil))))
|
(st/emit! (dw/end-rename-shape shape-id nil))))
|
||||||
|
|
||||||
on-key-down
|
on-key-down
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
|
|
Loading…
Add table
Reference in a new issue