Skip to content

Commit

Permalink
fix subs bug (#15680)
Browse files Browse the repository at this point in the history
  • Loading branch information
flexsurfer authored Apr 18, 2023
1 parent 5d0b739 commit 05b8dd5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/status_im2/common/toasts/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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))]))

0 comments on commit 05b8dd5

Please sign in to comment.