|
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
|
|
298 | 299 |
|
299 | 300 | (defn- replace-multiaccount-image-uri
|
300 | 301 | [profile ens-names port font-file avatar-opts]
|
301 |
| - (let [{:keys [key-uid ens-name? images]} profile |
302 |
| - ens-name? (or ens-name? (seq ens-names)) |
303 |
| - theme (theme/get-theme) |
304 |
| - avatar-opts (assoc avatar-opts :override-ring? (when ens-name? false)) |
305 |
| - images-with-uri (mapv (fn [{key-uid :keyUid image-name :type :as image}] |
306 |
| - (let [uri-fn (image-server/get-account-image-uri-fn |
307 |
| - (merge |
308 |
| - {:port port |
309 |
| - :ratio pixel-ratio/ratio |
310 |
| - :image-name image-name |
311 |
| - :key-uid key-uid |
312 |
| - :theme theme} |
313 |
| - avatar-opts))] |
314 |
| - (assoc image :fn uri-fn))) |
315 |
| - images) |
316 |
| - new-images (if (seq images-with-uri) |
317 |
| - images-with-uri |
318 |
| - [{:fn (image-server/get-initials-avatar-uri-fn |
319 |
| - (merge {:port port |
320 |
| - :ratio pixel-ratio/ratio |
321 |
| - :uppercase-ratio |
322 |
| - (:uppercase-ratio |
323 |
| - constants/initials-avatar-font-conf) |
324 |
| - :key-uid key-uid |
325 |
| - :theme theme |
326 |
| - :font-file font-file} |
327 |
| - avatar-opts))}])] |
| 302 | + (let [{:keys [key-uid ens-name? images |
| 303 | + customization-color]} profile |
| 304 | + ens-name? (or ens-name? (seq ens-names)) |
| 305 | + theme (theme/get-theme) |
| 306 | + avatar-opts (assoc avatar-opts :override-ring? (when ens-name? false)) |
| 307 | + images-with-uri (mapv (fn [{key-uid :keyUid image-name :type :as image}] |
| 308 | + (let [uri-fn (image-server/get-account-image-uri-fn |
| 309 | + (merge |
| 310 | + {:port port |
| 311 | + :ratio pixel-ratio/ratio |
| 312 | + :image-name image-name |
| 313 | + :key-uid key-uid |
| 314 | + :theme theme} |
| 315 | + avatar-opts))] |
| 316 | + (assoc image :fn uri-fn))) |
| 317 | + images) |
| 318 | + new-images (if (seq images-with-uri) |
| 319 | + images-with-uri |
| 320 | + [{:fn (image-server/get-initials-avatar-uri-fn |
| 321 | + (merge {:port port |
| 322 | + :ratio pixel-ratio/ratio |
| 323 | + :uppercase-ratio |
| 324 | + (:uppercase-ratio |
| 325 | + constants/initials-avatar-font-conf) |
| 326 | + :key-uid key-uid |
| 327 | + :customization-color customization-color |
| 328 | + :theme theme |
| 329 | + :font-file font-file} |
| 330 | + avatar-opts))}])] |
328 | 331 | (assoc profile :images new-images)))
|
329 | 332 |
|
330 | 333 | (re-frame/reg-sub
|
|
0 commit comments