diff --git a/src/status_im/common/bottom_sheet_screen/view.cljs b/src/status_im/common/bottom_sheet_screen/view.cljs index d02f1002edf3..498dad3383da 100644 --- a/src/status_im/common/bottom_sheet_screen/view.cljs +++ b/src/status_im/common/bottom_sheet_screen/view.cljs @@ -87,7 +87,7 @@ [content {:insets insets :close close - :scroll-enabled? @scroll-enabled? + :scroll-enabled? scroll-enabled? :current-scroll curr-scroll :on-scroll #(on-scroll % curr-scroll) :sheet-animating? animating?}]]]])))) diff --git a/src/status_im/common/emoji_picker/view.cljs b/src/status_im/common/emoji_picker/view.cljs index aab8ac028bed..e09e8754fe76 100644 --- a/src/status_im/common/emoji_picker/view.cljs +++ b/src/status_im/common/emoji_picker/view.cljs @@ -98,7 +98,7 @@ on-select set-scroll-ref close sheet-animating?]}] [gesture/flat-list {:ref set-scroll-ref - :scroll-enabled scroll-enabled? + :scroll-enabled @scroll-enabled? :data (or filtered-data emoji-picker.data/flatten-data) :initial-num-to-render 14 :max-to-render-per-batch 10 diff --git a/src/status_im/contexts/chat/home/new_chat/view.cljs b/src/status_im/contexts/chat/home/new_chat/view.cljs index 2aa656c49ef9..1ac18f50ab68 100644 --- a/src/status_im/contexts/chat/home/new_chat/view.cljs +++ b/src/status_im/contexts/chat/home/new_chat/view.cljs @@ -105,7 +105,7 @@ :render-section-header-fn contact-list/contacts-section-header :content-container-style {:padding-bottom 70} :render-fn contact-item-render - :scroll-enabled scroll-enabled? + :scroll-enabled @scroll-enabled? :on-scroll on-scroll}]) (when contacts-selected? [quo/button diff --git a/src/status_im/contexts/chat/messenger/composer/actions/view.cljs b/src/status_im/contexts/chat/messenger/composer/actions/view.cljs index 2b8248334282..173b2d3269d8 100644 --- a/src/status_im/contexts/chat/messenger/composer/actions/view.cljs +++ b/src/status_im/contexts/chat/messenger/composer/actions/view.cljs @@ -192,7 +192,7 @@ (.blur ^js @input-ref)) (rf/dispatch [:chat.ui/set-input-content-height (reanimated/get-shared-value height)]) - (rf/dispatch [:open-modal :photo-selector {:insets insets}])) + (rf/dispatch [:photo-selector/navigate-to-photo-selector])) :on-denied (fn [] (alert.effects/show-popup (i18n/label :t/error) (i18n/label diff --git a/src/status_im/contexts/chat/messenger/photo_selector/album_selector/view.cljs b/src/status_im/contexts/chat/messenger/photo_selector/album_selector/view.cljs index b67bd316d36e..e58db9e70aea 100644 --- a/src/status_im/contexts/chat/messenger/photo_selector/album_selector/view.cljs +++ b/src/status_im/contexts/chat/messenger/photo_selector/album_selector/view.cljs @@ -87,7 +87,7 @@ :content-container-style {:padding-top 64 :padding-bottom 40} :key-fn key-fn - :scroll-enabled scroll-enabled? + :scroll-enabled @scroll-enabled? :on-scroll on-scroll :style {:height window-height}}]])) diff --git a/src/status_im/contexts/chat/messenger/photo_selector/events.cljs b/src/status_im/contexts/chat/messenger/photo_selector/events.cljs index 27f287f32931..2b8357fe4af1 100644 --- a/src/status_im/contexts/chat/messenger/photo_selector/events.cljs +++ b/src/status_im/contexts/chat/messenger/photo_selector/events.cljs @@ -1,5 +1,6 @@ (ns status-im.contexts.chat.messenger.photo-selector.events (:require + [re-frame.core :as re-frame] [status-im.constants :as constants] status-im.contexts.chat.messenger.photo-selector.effects [utils.i18n :as i18n] @@ -74,3 +75,9 @@ (when (and (< (count images) constants/max-album-photos) (not (some #(= (:uri image) (:uri %)) images))) {:effects.camera-roll/image-selected [image current-chat-id]}))) + +(re-frame/reg-event-fx :photo-selector/navigate-to-photo-selector + (fn [] + {:fx [[:dispatch [:open-modal :photo-selector]] + [:dispatch [:photo-selector/get-photos-for-selected-album]] + [:dispatch [:photo-selector/camera-roll-get-albums]]]})) diff --git a/src/status_im/contexts/chat/messenger/photo_selector/view.cljs b/src/status_im/contexts/chat/messenger/photo_selector/view.cljs index f25dc2949838..25b655c89656 100644 --- a/src/status_im/contexts/chat/messenger/photo_selector/view.cljs +++ b/src/status_im/contexts/chat/messenger/photo_selector/view.cljs @@ -70,13 +70,14 @@ (let [customization-color (rf/sub [:profile/customization-color]) item-selected? (some #(= (:uri item) (:uri %)) @selected)] [rn/touchable-opacity - {:on-press (fn [] - (if item-selected? - (swap! selected remove-selected item) - (if (>= (count @selected) constants/max-album-photos) - (show-photo-limit-toast) - (swap! selected conj item)))) - :accessibility-label (str "image-" index)} + {:on-press (fn [] + (if item-selected? + (swap! selected remove-selected item) + (if (>= (count @selected) constants/max-album-photos) + (show-photo-limit-toast) + (swap! selected conj item)))) + :allow-multiple-presses? true + :accessibility-label (str "image-" index)} [rn/image {:source {:uri (:uri item)} :style (style/image window-width index)}] @@ -91,8 +92,6 @@ (defn photo-selector [{:keys [scroll-enabled? on-scroll current-scroll close] :as sheet}] - (rf/dispatch [:photo-selector/get-photos-for-selected-album]) - (rf/dispatch [:photo-selector/camera-roll-get-albums]) (let [album? (reagent/atom false) customization-color (rf/sub [:profile/customization-color]) sending-image (into [] (vals (rf/sub [:chats/sending-image]))) @@ -134,7 +133,7 @@ :padding-bottom (+ (safe-area/get-bottom) 100) :padding-top 64} :on-scroll on-scroll - :scroll-enabled scroll-enabled? + :scroll-enabled @scroll-enabled? :on-end-reached (fn [] (when (and (not loading?) has-next-page?) (rf/dispatch [:photo-selector/camera-roll-loading-more true]) diff --git a/src/status_im/contexts/communities/actions/addresses_for_permissions/view.cljs b/src/status_im/contexts/communities/actions/addresses_for_permissions/view.cljs index c4450884004d..337537162d93 100644 --- a/src/status_im/contexts/communities/actions/addresses_for_permissions/view.cljs +++ b/src/status_im/contexts/communities/actions/addresses_for_permissions/view.cljs @@ -92,7 +92,7 @@ :share-all-addresses? share-all-addresses? :community-color color} :content-container-style {:padding-horizontal 20} - :scroll-enabled scroll-enabled? + :scroll-enabled @scroll-enabled? :on-scroll on-scroll :key-fn :address :data accounts}]