Skip to content

Commit

Permalink
notification bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
awb99 committed Apr 2, 2024
1 parent 190f46c commit 35bb4b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/modular/oauth2/request.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
:oauth2/request-error
(fn [{:keys [db]} [_ provider res]]
(errorf "oauth2 provider: %s error: %s" provider res)
(add-notification :error (str "request error " provider ": " (err-msg res)))
(show-notification :error (str "request error " provider ": " (err-msg res)))
{}))

(rf/reg-event-fx
:oauth2/login-error
(fn [{:keys [db]} [_ provider]]
(errorf "oauth2 provider: %s error" provider)
(add-notification :danger "oauth login error (token not received)")
(show-notification :danger "oauth login error (token not received)")
{}))

6 changes: 3 additions & 3 deletions src/modular/oauth2/user/login_dialog.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[taoensso.timbre :refer-macros [info error]]
[reagent.core :as r]
[re-frame.core :as rf]
[frontend.notifications.core :refer [add-notification]]))
[frontend.notification :refer [show-notification]]))

(defn login-ui []
(let [username (r/atom "")
Expand Down Expand Up @@ -70,9 +70,9 @@
(info "login result: " result)
(rf/dispatch [:modal/close])
(when error
(add-notification :error error-message))
(show-notification :error error-message))
(when user
(add-notification :info (str "Logged in as: " user)))
(show-notification :info (str "Logged in as: " user)))
(if user
(assoc db :user result)
db)))
Expand Down

0 comments on commit 35bb4b6

Please sign in to comment.