Skip to content

Commit

Permalink
[#8937] Recent stickers are shown when stickers tab is highlighted
Browse files Browse the repository at this point in the history
  • Loading branch information
flexsurfer committed Sep 30, 2019
1 parent 371c66a commit f0a4d83
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/status_im/ui/screens/chat/stickers/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,16 @@

(defn update-scroll-position [ref installed-packs selected-pack window-width]
(when ref
(let [x (if (= selected-pack :recent)
0
(* (inc (some #(when (= selected-pack (:id (second %))) (first %))
(map-indexed vector installed-packs)))
window-width))]
(.scrollTo ref (clj->js {:x x :animated true})))))
;; bug on Android https://github.com/facebook/react-native/issues/24531
(js/setTimeout
(fn []
(let [x (if (= selected-pack :recent)
0
(* (inc (some #(when (= selected-pack (:id (second %))) (first %))
(map-indexed vector installed-packs)))
window-width))]
(.scrollTo ref #js {:x x :animated true})))
200)))

(defn on-scroll [e installed-packs window-width]
(let [num (/ (.-nativeEvent.contentOffset.x e) window-width)
Expand Down

0 comments on commit f0a4d83

Please sign in to comment.