aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/tau/events.cljs
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/tau/events.cljs')
-rw-r--r--src/frontend/tau/events.cljs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/frontend/tau/events.cljs b/src/frontend/tau/events.cljs
index d6f9743..12404dc 100644
--- a/src/frontend/tau/events.cljs
+++ b/src/frontend/tau/events.cljs
@@ -210,10 +210,20 @@
(rf/reg-event-db
::toggle-comments
- (fn [db [_ res]]
+ (fn [db _]
(assoc-in db [:stream :show-comments] (not (-> db :stream :show-comments)))))
(rf/reg-event-db
+ ::toggle-comment-replies
+ (fn [db [_ comment-id]]
+ (update-in db [:stream :comments-page :comments]
+ (fn [comments]
+ (map #(if (= (:id %) comment-id)
+ (assoc % :show-replies (not (:show-replies %)))
+ %)
+ comments)))))
+
+(rf/reg-event-db
::load-paginated-comments
(fn [db [_ res]]
(-> db