|
61 | 61 | :<- [:mediaserver/port]
|
62 | 62 | :<- [:initials-avatar-font-file]
|
63 | 63 | (fn [[profiles port font-file] [_ target-key-uid]]
|
64 |
| - (let [{:keys [images ens-name?] :as profile} (get profiles target-key-uid) |
65 |
| - image-name (-> images first :type) |
66 |
| - override-ring? (when ens-name? false)] |
| 64 | + (let [{:keys [images ens-name? customization-color] :as profile} (get profiles target-key-uid) |
| 65 | + image-name (-> images first :type) |
| 66 | + override-ring? (when ens-name? false)] |
67 | 67 | (when profile
|
68 | 68 | {:fn
|
69 | 69 | (if image-name
|
|
74 | 74 | :theme (theme/get-theme)
|
75 | 75 | :override-ring? override-ring?})
|
76 | 76 | (image-server/get-initials-avatar-uri-fn
|
77 |
| - {:port port |
78 |
| - :ratio pixel-ratio/ratio |
79 |
| - :key-uid target-key-uid |
80 |
| - :theme (theme/get-theme) |
81 |
| - :uppercase-ratio (:uppercase-ratio constants/initials-avatar-font-conf) |
82 |
| - :override-ring? override-ring? |
83 |
| - :font-file font-file}))})))) |
| 77 | + {:port port |
| 78 | + :ratio pixel-ratio/ratio |
| 79 | + :key-uid target-key-uid |
| 80 | + :theme (theme/get-theme) |
| 81 | + :uppercase-ratio (:uppercase-ratio constants/initials-avatar-font-conf) |
| 82 | + :customization-color customization-color |
| 83 | + :override-ring? override-ring? |
| 84 | + :font-file font-file}))})))) |
84 | 85 |
|
85 | 86 | (re-frame/reg-sub
|
86 | 87 | :multiaccount/public-key
|
|
305 | 306 |
|
306 | 307 | (defn- replace-multiaccount-image-uri
|
307 | 308 | [profile ens-names port font-file avatar-opts]
|
308 |
| - (let [{:keys [key-uid ens-name? images]} profile |
309 |
| - ens-name? (or ens-name? (seq ens-names)) |
310 |
| - theme (theme/get-theme) |
311 |
| - avatar-opts (assoc avatar-opts :override-ring? (when ens-name? false)) |
312 |
| - images-with-uri (mapv (fn [{key-uid :keyUid image-name :type :as image}] |
313 |
| - (let [uri-fn (image-server/get-account-image-uri-fn |
314 |
| - (merge |
315 |
| - {:port port |
316 |
| - :ratio pixel-ratio/ratio |
317 |
| - :image-name image-name |
318 |
| - :key-uid key-uid |
319 |
| - :theme theme} |
320 |
| - avatar-opts))] |
321 |
| - (assoc image :fn uri-fn))) |
322 |
| - images) |
323 |
| - new-images (if (seq images-with-uri) |
324 |
| - images-with-uri |
325 |
| - [{:fn (image-server/get-initials-avatar-uri-fn |
326 |
| - (merge {:port port |
327 |
| - :ratio pixel-ratio/ratio |
328 |
| - :uppercase-ratio |
329 |
| - (:uppercase-ratio |
330 |
| - constants/initials-avatar-font-conf) |
331 |
| - :key-uid key-uid |
332 |
| - :theme theme |
333 |
| - :font-file font-file} |
334 |
| - avatar-opts))}])] |
| 309 | + (let [{:keys [key-uid ens-name? images |
| 310 | + customization-color]} profile |
| 311 | + ens-name? (or ens-name? (seq ens-names)) |
| 312 | + theme (theme/get-theme) |
| 313 | + avatar-opts (assoc avatar-opts :override-ring? (when ens-name? false)) |
| 314 | + images-with-uri (mapv (fn [{key-uid :keyUid image-name :type :as image}] |
| 315 | + (let [uri-fn (image-server/get-account-image-uri-fn |
| 316 | + (merge |
| 317 | + {:port port |
| 318 | + :ratio pixel-ratio/ratio |
| 319 | + :image-name image-name |
| 320 | + :key-uid key-uid |
| 321 | + :theme theme} |
| 322 | + avatar-opts))] |
| 323 | + (assoc image :fn uri-fn))) |
| 324 | + images) |
| 325 | + new-images (if (seq images-with-uri) |
| 326 | + images-with-uri |
| 327 | + [{:fn (image-server/get-initials-avatar-uri-fn |
| 328 | + (merge {:port port |
| 329 | + :ratio pixel-ratio/ratio |
| 330 | + :uppercase-ratio |
| 331 | + (:uppercase-ratio |
| 332 | + constants/initials-avatar-font-conf) |
| 333 | + :key-uid key-uid |
| 334 | + :customization-color customization-color |
| 335 | + :theme theme |
| 336 | + :font-file font-file} |
| 337 | + avatar-opts))}])] |
335 | 338 | (assoc profile :images new-images)))
|
336 | 339 |
|
337 | 340 | (re-frame/reg-sub
|
|
0 commit comments