From 22757bf744e5b4a4e6ec14e0d98d37d71fb7798a Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Mon, 8 Jan 2018 10:48:16 -0500 Subject: [PATCH] Properly set badge text and color --- src/background/looped_in/background.cljs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/background/looped_in/background.cljs b/src/background/looped_in/background.cljs index 7173bb6..bce6204 100644 --- a/src/background/looped_in/background.cljs +++ b/src/background/looped_in/background.cljs @@ -2,10 +2,13 @@ (enable-console-print!) +(def browser-action (.-browserAction js/browser)) + (-> js/browser (.-runtime) (.-onMessage) (.addListener (fn [msg] - (-> js/browser - (.-browserAction) - (.setBadgeText (.-numComments msg)))))) + (prn msg) + (.setBadgeBackgroundColor browser-action #js {:color "#232323"}) + (.setBadgeText browser-action + #js {:text (str (.-numComments msg))}))))