0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-26 08:29:42 -05:00

Assign profile avatar on profile update.

This commit is contained in:
Andrey Antukh 2020-04-27 09:53:47 +02:00 committed by Alonso Torres
parent f4f79008a4
commit f2e4417d87
2 changed files with 5 additions and 4 deletions

View file

@ -15,6 +15,7 @@
[uxbox.main.repo :as rp]
[uxbox.util.i18n :as i18n :refer [tr]]
[uxbox.util.storage :refer [storage]]
[uxbox.util.avatars :as avatars]
[uxbox.util.theme :as theme]))
;; --- Common Specs
@ -48,9 +49,10 @@
(ptk/reify ::profile-fetched
ptk/UpdateEvent
(update [_ state]
(assoc state :profile (cond-> data
(nil? (:lang data)) (assoc :lang cfg/default-language)
(nil? (:theme data)) (assoc :theme cfg/default-theme))))
(let [profile (avatars/assign data)]
(assoc state :profile (cond-> profile
(nil? (:lang data)) (assoc :lang cfg/default-language)
(nil? (:theme data)) (assoc :theme cfg/default-theme)))))
ptk/EffectEvent
(effect [_ state stream]

View file

@ -58,7 +58,6 @@
(let [locale (i18n/use-locale)
form (fm/use-form ::profile-form #(deref refs/profile))
data (:data form)]
(prn "data" form)
[:form.profile-form {:on-submit #(on-submit % form)}
[:span.settings-label (t locale "settings.profile.section-basic-data")]