0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-22 22:49:01 -05:00

🐛 Fix wrong email in the info message at change email

This commit is contained in:
Pablo Alba 2022-10-18 12:30:38 +02:00 committed by Alejandro Alonso
parent 02382b95f6
commit 821981e579
2 changed files with 13 additions and 7 deletions

View file

@ -10,6 +10,8 @@
- Fix wrong validation text after interaction with 2 and more files [Taiga #4276](https://tree.taiga.io/project/penpot/issue/4276) - Fix wrong validation text after interaction with 2 and more files [Taiga #4276](https://tree.taiga.io/project/penpot/issue/4276)
- Fix auto-width for texts can make text appear stretched [Github #2482](https://github.com/penpot/penpot/issues/2482) - Fix auto-width for texts can make text appear stretched [Github #2482](https://github.com/penpot/penpot/issues/2482)
- Fix boards name do not disappear in focus mode [#4272](https://tree.taiga.io/project/penpot/issue/4272) - Fix boards name do not disappear in focus mode [#4272](https://tree.taiga.io/project/penpot/issue/4272)
- Fix wrong email in the info message at change email [Taiga #4274](https://tree.taiga.io/project/penpot/issue/4274)
## 1.16.0-beta ## 1.16.0-beta
### :boom: Breaking changes & Deprecations ### :boom: Breaking changes & Deprecations

View file

@ -52,20 +52,19 @@
(rx/throw error))) (rx/throw error)))
(defn- on-success (defn- on-success
[form data] [profile data]
(if (:changed data) (if (:changed data)
(st/emit! (du/fetch-profile) (st/emit! (du/fetch-profile)
(modal/hide)) (modal/hide))
(let [email (get-in @form [:clean-data :email-1]) (let [message (tr "notifications.validation-email-sent" (:email profile))]
message (tr "notifications.validation-email-sent" email)]
(st/emit! (dm/info message) (st/emit! (dm/info message)
(modal/hide))))) (modal/hide)))))
(defn- on-submit (defn- on-submit
[form _event] [profile form _event]
(let [params {:email (get-in @form [:clean-data :email-1])} (let [params {:email (get-in @form [:clean-data :email-1])}
mdata {:on-error (partial on-error form) mdata {:on-error (partial on-error form)
:on-success (partial on-success form)}] :on-success (partial on-success profile)}]
(st/emit! (du/request-email-change (with-meta params mdata))))) (st/emit! (du/request-email-change (with-meta params mdata)))))
(mf/defc change-email-modal (mf/defc change-email-modal
@ -77,7 +76,12 @@
:validators [email-equality] :validators [email-equality]
:initial profile) :initial profile)
on-close on-close
(mf/use-callback #(st/emit! (modal/hide)))] (mf/use-callback #(st/emit! (modal/hide)))
on-submit
(mf/use-callback
(mf/deps profile)
(partial on-submit profile))]
[:div.modal-overlay [:div.modal-overlay
[:div.modal-container.change-email-modal.form-container [:div.modal-container.change-email-modal.form-container
@ -86,7 +90,7 @@
[:div.modal-header [:div.modal-header
[:div.modal-header-title [:div.modal-header-title
[:h2 {:data-test "change-email-title"} [:h2 {:data-test "change-email-title"}
(tr "modals.change-email.title")]] (tr "modals.change-email.title")]]
[:div.modal-close-button [:div.modal-close-button
{:on-click on-close} i/close]] {:on-click on-close} i/close]]