Merge pull request #5366 from penpot/niwinz-bugfix-1

🐛 Bugfixes
This commit is contained in:
Alejandro 2024-11-25 11:32:28 +01:00 committed by GitHub
commit 7a0702650a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 20 additions and 18 deletions

View file

@ -450,7 +450,9 @@
(ptk/reify ::update-team
ptk/UpdateEvent
(update [_ state]
(assoc-in state [:teams id :name] name))
(-> state
(assoc-in [:teams id :name] name)
(assoc-in [:team :name] name)))
ptk/WatchEvent
(watch [_ _ _]

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