From 05b8dd563e38d8197d8e8debbf8f580116c2bca8 Mon Sep 17 00:00:00 2001 From: flexsurfer Date: Tue, 18 Apr 2023 19:30:39 +0200 Subject: [PATCH] fix subs bug (#15680) --- src/status_im2/common/toasts/view.cljs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/status_im2/common/toasts/view.cljs b/src/status_im2/common/toasts/view.cljs index f29733678f..3abdb935f3 100644 --- a/src/status_im2/common/toasts/view.cljs +++ b/src/status_im2/common/toasts/view.cljs @@ -43,7 +43,7 @@ [:f> (fn [] (let [duration (or (rf/sub [:toasts/toast-cursor id :duration]) 3000) - on-dismissed #((or (rf/sub [:toasts/toast-cursor id :on-dismissed]) identity) id) + on-dismissed (or (rf/sub [:toasts/toast-cursor id :on-dismissed]) identity) create-timer (fn [] (reset! timer (utils.utils/set-timeout close! duration))) translate-y (reanimated/use-shared-value 0) @@ -80,7 +80,7 @@ (create-timer)))))] ;; create auto dismiss timer, clear timer when unmount or duration changed (rn/use-effect (fn [] (create-timer) clear-timer) [duration]) - (rn/use-unmount on-dismissed) + (rn/use-unmount #(on-dismissed id)) [gesture/gesture-detector {:gesture pan} [reanimated/view {;; TODO: this will enable layout animation at runtime and causing flicker on android @@ -100,4 +100,5 @@ [into [rn/view {:style style/outmost-transparent-container}] - (map (fn [id] ^{:key id} [container id]) toasts-ordered)])) + (doall + (map (fn [id] ^{:key id} [container id]) toasts-ordered))]))