Browse Source

fix: notification status somehow takes non-keyword status

Tienson Qin 3 months ago
parent
commit
0860d295db
2 changed files with 2 additions and 1 deletions
  1. 1 0
      src/main/frontend/handler/notification.cljs
  2. 1 1
      src/main/frontend/ui.cljs

+ 1 - 0
src/main/frontend/handler/notification.cljs

@@ -26,6 +26,7 @@
   ([content status clear? uid timeout]
    (show! content status clear? uid timeout nil))
   ([content status clear? uid timeout close-cb]
+   (assert (keyword? status) "status should be a keyword")
    (let [contents (state/get-notification-contents)
          uid (or uid (keyword (util/unique-id)))]
      (state/set-state! :notification/contents (assoc contents

+ 1 - 1
src/main/frontend/ui.cljs

@@ -295,7 +295,7 @@
               (icon "info-circle" {:class "text-indigo-500" :size "20"}))
             status)]
       [:div.ui__notifications-content
-       {:class (str "notification-" (name (or status :info)))
+       {:class (str "notification-" (name (or (when (keyword? status) status) :info)))
         :style
         (when (or (= state "exiting")
                   (= state "exited"))