fix: identifier rings are displayed on avatars for users with a set ENS (#17346)

This commit is contained in:
frank 2023-09-22 21:51:54 +08:00 committed by GitHub
parent a99ae74da7
commit 7543dc9001
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -39,7 +39,7 @@
:background-color intials avatar background color
:color intials avatar text color
:size intials avatar radius
:ring? render ident ring around avatar?}
:ring? render ident ring around avatar? NOTE: this option may not work if override-ring? is not nil}
supported color formats:
#RRGGBB

View File

@ -247,8 +247,9 @@
(pos? (count (get multiaccount :images)))))
(defn- replace-multiaccount-image-uri
[multiaccount port font-file avatar-opts]
[multiaccount ens-names port font-file avatar-opts]
(let [{:keys [key-uid ens-name? images]} multiaccount
ens-name? (or ens-name? (seq ens-names))
theme (theme/get-theme)
avatar-opts (assoc avatar-opts :override-ring? (when ens-name? false))
images-with-uri (mapv (fn [{key-uid :keyUid image-name :type :as image}]
@ -273,10 +274,11 @@
(re-frame/reg-sub
:profile/multiaccount
:<- [:profile/profile]
:<- [:ens/names]
:<- [:mediaserver/port]
:<- [:initials-avatar-font-file]
(fn [[multiaccount port font-file] [_ avatar-opts]]
(replace-multiaccount-image-uri multiaccount port font-file avatar-opts)))
(fn [[multiaccount ens-names port font-file] [_ avatar-opts]]
(replace-multiaccount-image-uri multiaccount ens-names port font-file avatar-opts)))
(re-frame/reg-sub
:profile/login-profile