0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-06 12:01:19 -05:00

🐛 Fix incorrect internal form initialization

This commit is contained in:
Andrey Antukh 2024-11-25 09:53:49 +01:00
parent 9b71e04e1c
commit 3ddd45e99b
2 changed files with 4 additions and 4 deletions

View file

@ -73,7 +73,9 @@
{::mf/register modal/components
::mf/register-as :team-form}
[{:keys [team] :as props}]
(let [initial (mf/use-memo (fn [] (or team {})))
(let [initial (mf/use-memo (fn []
(or (some-> team (select-keys [:name :id]))
{})))
form (fm/use-form :schema schema:team-form
:initial initial)
handle-keydown

View file

@ -148,9 +148,7 @@
(mf/set-ref-val! internal-state initial))
(mf/with-effect [initial]
(if (fn? initial)
(swap! form-mutator update :data merge (initial))
(swap! form-mutator update :data merge initial)))
(swap! form-mutator d/deep-merge initial))
form-mutator))