mirror of
https://github.com/status-im/status-mobile.git
synced 2025-03-01 16:50:58 +00:00
25 lines
701 B
Clojure
25 lines
701 B
Clojure
(ns status-im.participants.handlers
|
|
(:require [status-im.navigation.handlers :as nav]
|
|
[re-frame.core :refer [debug]]
|
|
[status-im.utils.handlers :refer [register-handler]]))
|
|
|
|
(defmethod nav/preload-data! :add-participants
|
|
[db _]
|
|
(assoc db :selected-participants #{}))
|
|
|
|
(defmethod nav/preload-data! :remove-participants
|
|
[db _]
|
|
(assoc db :selected-participants #{}))
|
|
|
|
(defn deselect-participant
|
|
[db [_ id]]
|
|
(update db :selected-participants disj id))
|
|
|
|
(register-handler :deselect-participant deselect-participant)
|
|
|
|
(defn select-participant
|
|
[db [_ id]]
|
|
(update db :selected-participants conj id))
|
|
|
|
(register-handler :select-participant (debug select-participant))
|