From f419eb049cbe6374a9ae75ad5cea584994732d62 Mon Sep 17 00:00:00 2001 From: "Robert C. Martin" Date: Sun, 25 Jun 2023 13:08:00 -0500 Subject: [PATCH] improve the way avatars are rendered. --- src/more_speech/ui/swing/article_panel.clj | 12 +++++++----- src/more_speech/ui/swing/users_window.clj | 3 +-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/more_speech/ui/swing/article_panel.clj b/src/more_speech/ui/swing/article_panel.clj index 54e85f1..31a32da 100644 --- a/src/more_speech/ui/swing/article_panel.clj +++ b/src/more_speech/ui/swing/article_panel.clj @@ -333,11 +333,13 @@ (text! replies-label "Repliesâ–¶")) - (let [avatar-label (select main-frame [:#avatar-id])] - (future (config! avatar-label - :text (if (some? (:picture profile)) - (format "" (:picture profile)) - "")))) + (let [avatar-label (select main-frame [:#avatar-id]) + picture (:picture profile)] + (when new-id? + (config! avatar-label :text "")) + (when (some? picture) + (future (config! avatar-label + :text (format "" picture))))) (text! subject-label (formatters/get-subject (:tags event))) (text! relays-label (format "%d %s" (count (:relays event)) diff --git a/src/more_speech/ui/swing/users_window.clj b/src/more_speech/ui/swing/users_window.clj index 313f6d6..4c4bba0 100644 --- a/src/more_speech/ui/swing/users_window.clj +++ b/src/more_speech/ui/swing/users_window.clj @@ -32,8 +32,7 @@ (defn make-sorted-listbox-items [ids] (sort-by first (map #(vector (formatters/format-user-id % 70 40) %) - ids)) - ) + ids))) (defn render-listbox-item [widget item] (let [value (:value item)]