Skip to content

Commit f394fcc

Browse files
authored
fix android hardware back button is not working for nested sheet-screens (#18886)
1 parent 107f263 commit f394fcc

File tree

1 file changed

+5
-4
lines changed
  • src/status_im/common/bottom_sheet_screen

1 file changed

+5
-4
lines changed

Diff for: src/status_im/common/bottom_sheet_screen/view.cljs

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
[quo.theme :as theme]
55
[react-native.core :as rn]
66
[react-native.gesture :as gesture]
7-
[react-native.hooks :as hooks]
87
[react-native.platform :as platform]
98
[react-native.reanimated :as reanimated]
109
[react-native.safe-area :as safe-area]
@@ -58,18 +57,20 @@
5857
(set-animating-true)
5958
(reanimated/animate translate-y height 300)
6059
(reanimated/animate opacity 0 300)
61-
(rf/dispatch [:navigate-back]))
60+
(rf/dispatch [:navigate-back])
61+
true)
6262
reset-open-sheet (fn []
6363
(reanimated/animate translate-y 0 300)
6464
(reanimated/animate opacity 1 300)
6565
(set-animating-false 300)
6666
(reset! scroll-enabled? true))]
6767
(rn/use-effect
6868
(fn []
69+
(rn/hw-back-add-listener close)
6970
(reanimated/animate translate-y 0 300)
7071
(reanimated/animate opacity 1 300)
71-
(set-animating-false 300)))
72-
(hooks/use-back-handler close)
72+
(set-animating-false 300)
73+
#(rn/hw-back-remove-listener close)))
7374
[rn/view {:style (style/container insets)}
7475
(when-not skip-background?
7576
[reanimated/view {:style (style/background opacity)}])

0 commit comments

Comments
 (0)