|
60 | 60 | :<- [:mediaserver/port]
|
61 | 61 | :<- [:initials-avatar-font-file]
|
62 | 62 | (fn [[profiles port font-file] [_ target-key-uid]]
|
63 |
| - (let [{:keys [images ens-name?] :as profile} (get profiles target-key-uid) |
64 |
| - image-name (-> images first :type) |
65 |
| - override-ring? (when ens-name? false)] |
| 63 | + (let [{:keys [images ens-name? customization-color] :as profile} (get profiles target-key-uid) |
| 64 | + image-name (-> images first :type) |
| 65 | + override-ring? (when ens-name? false)] |
66 | 66 | (when profile
|
67 | 67 | {:fn
|
68 | 68 | (if image-name
|
|
73 | 73 | :theme (theme/get-theme)
|
74 | 74 | :override-ring? override-ring?})
|
75 | 75 | (image-server/get-initials-avatar-uri-fn
|
76 |
| - {:port port |
77 |
| - :ratio pixel-ratio/ratio |
78 |
| - :key-uid target-key-uid |
79 |
| - :theme (theme/get-theme) |
80 |
| - :uppercase-ratio (:uppercase-ratio constants/initials-avatar-font-conf) |
81 |
| - :override-ring? override-ring? |
82 |
| - :font-file font-file}))})))) |
| 76 | + {:port port |
| 77 | + :ratio pixel-ratio/ratio |
| 78 | + :key-uid target-key-uid |
| 79 | + :theme (theme/get-theme) |
| 80 | + :uppercase-ratio (:uppercase-ratio constants/initials-avatar-font-conf) |
| 81 | + :customization-color customization-color |
| 82 | + :override-ring? override-ring? |
| 83 | + :font-file font-file}))})))) |
83 | 84 |
|
84 | 85 | (re-frame/reg-sub
|
85 | 86 | :multiaccount/public-key
|
|
292 | 293 |
|
293 | 294 | (defn- replace-multiaccount-image-uri
|
294 | 295 | [profile ens-names port font-file avatar-opts]
|
295 |
| - (let [{:keys [key-uid ens-name? images]} profile |
296 |
| - ens-name? (or ens-name? (seq ens-names)) |
297 |
| - theme (theme/get-theme) |
298 |
| - avatar-opts (assoc avatar-opts :override-ring? (when ens-name? false)) |
299 |
| - images-with-uri (mapv (fn [{key-uid :keyUid image-name :type :as image}] |
300 |
| - (let [uri-fn (image-server/get-account-image-uri-fn |
301 |
| - (merge |
302 |
| - {:port port |
303 |
| - :ratio pixel-ratio/ratio |
304 |
| - :image-name image-name |
305 |
| - :key-uid key-uid |
306 |
| - :theme theme} |
307 |
| - avatar-opts))] |
308 |
| - (assoc image :fn uri-fn))) |
309 |
| - images) |
310 |
| - new-images (if (seq images-with-uri) |
311 |
| - images-with-uri |
312 |
| - [{:fn (image-server/get-initials-avatar-uri-fn |
313 |
| - (merge {:port port |
314 |
| - :ratio pixel-ratio/ratio |
315 |
| - :uppercase-ratio |
316 |
| - (:uppercase-ratio |
317 |
| - constants/initials-avatar-font-conf) |
318 |
| - :key-uid key-uid |
319 |
| - :theme theme |
320 |
| - :font-file font-file} |
321 |
| - avatar-opts))}])] |
| 296 | + (let [{:keys [key-uid ens-name? images |
| 297 | + customization-color]} profile |
| 298 | + ens-name? (or ens-name? (seq ens-names)) |
| 299 | + theme (theme/get-theme) |
| 300 | + avatar-opts (assoc avatar-opts :override-ring? (when ens-name? false)) |
| 301 | + images-with-uri (mapv (fn [{key-uid :keyUid image-name :type :as image}] |
| 302 | + (let [uri-fn (image-server/get-account-image-uri-fn |
| 303 | + (merge |
| 304 | + {:port port |
| 305 | + :ratio pixel-ratio/ratio |
| 306 | + :image-name image-name |
| 307 | + :key-uid key-uid |
| 308 | + :theme theme} |
| 309 | + avatar-opts))] |
| 310 | + (assoc image :fn uri-fn))) |
| 311 | + images) |
| 312 | + new-images (if (seq images-with-uri) |
| 313 | + images-with-uri |
| 314 | + [{:fn (image-server/get-initials-avatar-uri-fn |
| 315 | + (merge {:port port |
| 316 | + :ratio pixel-ratio/ratio |
| 317 | + :uppercase-ratio |
| 318 | + (:uppercase-ratio |
| 319 | + constants/initials-avatar-font-conf) |
| 320 | + :key-uid key-uid |
| 321 | + :customization-color customization-color |
| 322 | + :theme theme |
| 323 | + :font-file font-file} |
| 324 | + avatar-opts))}])] |
322 | 325 | (assoc profile :images new-images)))
|
323 | 326 |
|
324 | 327 | (re-frame/reg-sub
|
|
0 commit comments