Skip to content

Commit

Permalink
Show notification when joining/leaving a campaign
Browse files Browse the repository at this point in the history
  • Loading branch information
dhleong committed Feb 9, 2019
1 parent 63a4698 commit 555fb19
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/cljs/wish/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -810,14 +810,23 @@
(let [info {:id campaign-id
:name ?campaign-name}]
(log/info "Joining " campaign-id)
(update-sheet-path cofx [] assoc :campaign info)

; TODO raise a notifier
)
(-> cofx
(update-sheet-path [] assoc :campaign info)

; raise a notifier
(assoc :dispatch [:notify! {:duration :short
:content (str "Joined "
(or (:name info)
"the campaign")
" successfully!")}])))

(do
(log/info "Leaving campaign")
(update-sheet-path cofx [] dissoc :campaign))

; TODO raise a notifier
)))
(-> cofx
(update-sheet-path [] dissoc :campaign)

; raise a notifier
(assoc :dispatch [:notify! {:duration :short
:content "Left the campaign successfully."}]))))))

0 comments on commit 555fb19

Please sign in to comment.