Skip to content

Commit

Permalink
Early return from subscription unless the profile is present
Browse files Browse the repository at this point in the history
  • Loading branch information
ilmotta committed May 7, 2024
1 parent 161ba27 commit fe65cb3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/status_im/subs/profile.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,12 @@
:<- [:initials-avatar-font-file]
:<- [:theme]
(fn [[profile ens-names port font-file theme] [_ avatar-opts]]
(replace-multiaccount-image-uri profile ens-names port font-file avatar-opts theme)))
;; Right after logout, this subscription is recomputed, but the sub
;; `:profile/profile` output will always be nil. We skip any further
;; processing because it's wasteful and because it will trigger a schema
;; error.
(when profile
(replace-multiaccount-image-uri profile ens-names port font-file avatar-opts theme))))

(re-frame/reg-sub
:profile/image
Expand Down

0 comments on commit fe65cb3

Please sign in to comment.