From a5592dfe049cc20961db2913d17d0f5097e8eaa5 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 1 May 2020 09:14:10 +0200 Subject: [PATCH] :bug: Show proper profile photo just after login. --- backend/src/uxbox/services/mutations/profile.clj | 3 ++- backend/src/uxbox/services/queries/profile.clj | 2 +- frontend/src/uxbox/main/data/auth.cljs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/src/uxbox/services/mutations/profile.clj b/backend/src/uxbox/services/mutations/profile.clj index 8d4250bf0d..91d2327df7 100644 --- a/backend/src/uxbox/services/mutations/profile.clj +++ b/backend/src/uxbox/services/mutations/profile.clj @@ -89,7 +89,8 @@ (defn- retrieve-profile-by-email [conn email] - (db/query-one conn [sql:profile-by-email email])) + (-> (db/query-one conn [sql:profile-by-email email]) + (p/then #(images/resolve-media-uris % [:photo :photo-uri])))) ;; --- Mutation: Update Profile (own) diff --git a/backend/src/uxbox/services/queries/profile.clj b/backend/src/uxbox/services/queries/profile.clj index 81c03aa8eb..897295aabb 100644 --- a/backend/src/uxbox/services/queries/profile.clj +++ b/backend/src/uxbox/services/queries/profile.clj @@ -94,4 +94,4 @@ (defn strip-private-attrs "Only selects a publicy visible profile attrs." [profile] - (select-keys profile [:id :fullname :lang :email :created-at :photo :theme])) + (select-keys profile [:id :fullname :lang :email :created-at :photo :theme :photo-uri])) diff --git a/frontend/src/uxbox/main/data/auth.cljs b/frontend/src/uxbox/main/data/auth.cljs index 51551c22c9..a16d62c562 100644 --- a/frontend/src/uxbox/main/data/auth.cljs +++ b/frontend/src/uxbox/main/data/auth.cljs @@ -65,7 +65,7 @@ (ptk/reify ::clear-user-data ptk/UpdateEvent (update [_ state] - (select-keys state [:route :router :session-id])) + (select-keys state [:route :router :session-id :history])) ptk/WatchEvent (watch [_ state s]