|
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 | ;; DEPRECATED
|
86 | 87 | ;; use `:profile/public-key` instead
|
|
319 | 320 |
|
320 | 321 | (defn- replace-multiaccount-image-uri
|
321 | 322 | [profile ens-names port font-file avatar-opts]
|
322 |
| - (let [{:keys [key-uid ens-name? images]} profile |
323 |
| - ens-name? (or ens-name? (seq ens-names)) |
324 |
| - theme (theme/get-theme) |
325 |
| - avatar-opts (assoc avatar-opts :override-ring? (when ens-name? false)) |
326 |
| - images-with-uri (mapv (fn [{key-uid :keyUid image-name :type :as image}] |
327 |
| - (let [uri-fn (image-server/get-account-image-uri-fn |
328 |
| - (merge |
329 |
| - {:port port |
330 |
| - :ratio pixel-ratio/ratio |
331 |
| - :image-name image-name |
332 |
| - :key-uid key-uid |
333 |
| - :theme theme} |
334 |
| - avatar-opts))] |
335 |
| - (assoc image :fn uri-fn))) |
336 |
| - images) |
337 |
| - new-images (if (seq images-with-uri) |
338 |
| - images-with-uri |
339 |
| - [{:fn (image-server/get-initials-avatar-uri-fn |
340 |
| - (merge {:port port |
341 |
| - :ratio pixel-ratio/ratio |
342 |
| - :uppercase-ratio |
343 |
| - (:uppercase-ratio |
344 |
| - constants/initials-avatar-font-conf) |
345 |
| - :key-uid key-uid |
346 |
| - :theme theme |
347 |
| - :font-file font-file} |
348 |
| - avatar-opts))}])] |
| 323 | + (let [{:keys [key-uid ens-name? images |
| 324 | + customization-color]} profile |
| 325 | + ens-name? (or ens-name? (seq ens-names)) |
| 326 | + theme (theme/get-theme) |
| 327 | + avatar-opts (assoc avatar-opts :override-ring? (when ens-name? false)) |
| 328 | + images-with-uri (mapv (fn [{key-uid :keyUid image-name :type :as image}] |
| 329 | + (let [uri-fn (image-server/get-account-image-uri-fn |
| 330 | + (merge |
| 331 | + {:port port |
| 332 | + :ratio pixel-ratio/ratio |
| 333 | + :image-name image-name |
| 334 | + :key-uid key-uid |
| 335 | + :theme theme} |
| 336 | + avatar-opts))] |
| 337 | + (assoc image :fn uri-fn))) |
| 338 | + images) |
| 339 | + new-images (if (seq images-with-uri) |
| 340 | + images-with-uri |
| 341 | + [{:fn (image-server/get-initials-avatar-uri-fn |
| 342 | + (merge {:port port |
| 343 | + :ratio pixel-ratio/ratio |
| 344 | + :uppercase-ratio |
| 345 | + (:uppercase-ratio |
| 346 | + constants/initials-avatar-font-conf) |
| 347 | + :key-uid key-uid |
| 348 | + :customization-color customization-color |
| 349 | + :theme theme |
| 350 | + :font-file font-file} |
| 351 | + avatar-opts))}])] |
349 | 352 | (assoc profile :images new-images)))
|
350 | 353 |
|
351 | 354 | (re-frame/reg-sub
|
|
0 commit comments