Properly set badge text and color

This commit is contained in:
Jeremy Dormitzer 2018-01-08 10:48:16 -05:00
parent 7ab7a9889d
commit 22757bf744
No known key found for this signature in database
GPG Key ID: 04F17C0F5A32C320

View File

@ -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))}))))