From 32fe10a6d94c7b2b9371735cc4c2c8a6f2155b97 Mon Sep 17 00:00:00 2001 From: Siddarth Kumar Date: Fri, 22 Mar 2024 20:48:03 +0530 Subject: [PATCH] make lint-fix --- src/legacy/status_im/bottom_sheet/view.cljs | 12 ++++---- src/legacy/status_im/chat/models/loading.cljs | 13 +++++---- .../status_im/chat/models/message_test.cljs | 23 ++++----------- src/legacy/status_im/ens/core.cljs | 10 +++---- src/legacy/status_im/keycard/fx.cljs | 4 +-- src/legacy/status_im/popover/core.cljs | 4 +-- .../status_im/ui/components/action_sheet.cljs | 4 +-- .../status_im/ui/components/colors.cljs | 18 ++++++++---- .../status_im/ui/components/list/item.cljs | 12 ++++---- .../status_im/ui/components/text_input.cljs | 7 ++--- .../status_im/ui/components/topbar.cljs | 5 ++-- .../ui/screens/browser/permissions/views.cljs | 29 +++++++++---------- .../ui/screens/reset_password/views.cljs | 4 +-- src/legacy/status_im/utils/random_test.cljs | 5 ++-- .../animated_header_flatlist/view.cljs | 3 +- .../components/avatars/user_avatar/view.cljs | 5 ++-- .../gradient/gradient_cover/view.cljs | 7 ++--- src/quo/components/graph/utils_test.cljs | 3 +- .../navigation/bottom_nav_tab/view.cljs | 8 ++--- .../components/navigation/top_nav/style.cljs | 3 +- .../buttons/record_button_big.cljs | 5 ++-- src/react_native/keychain.cljs | 24 +++++++-------- src/status_im/common/scan_qr_code/view.cljs | 4 +-- .../chat/messenger/composer/selection.cljs | 3 +- .../messages/content/deleted/view.cljs | 3 +- .../profile/contact/add_nickname/view.cljs | 3 +- .../profile/contact/block_contact/view.cljs | 3 +- .../contexts/profile/contact/header/view.cljs | 3 +- .../contexts/profile/contact/view.cljs | 3 +- src/status_im/contexts/profile/utils.cljs | 3 +- .../contact_verification/view.cljs | 5 ++-- .../components/floating_screens/style.cljs | 9 +++--- src/status_im/subs/shell.cljs | 6 ++-- 33 files changed, 117 insertions(+), 136 deletions(-) diff --git a/src/legacy/status_im/bottom_sheet/view.cljs b/src/legacy/status_im/bottom_sheet/view.cljs index c074e424ee89..70db00d90d54 100644 --- a/src/legacy/status_im/bottom_sheet/view.cljs +++ b/src/legacy/status_im/bottom_sheet/view.cljs @@ -187,9 +187,9 @@ (with-animation (+ bg-height-expanded (.-value pan-y)))) ;; Workaround for ;; https://github.com/software-mansion/react-native-reanimated/issues/1758#issue-817145741 - ;; withTiming/withSpring callback not working on-expanded should - ;; be called as a callback of with-animation instead, once this - ;; issue has been resolved + ;; withTiming/withSpring callback not working on-expanded + ;; should be called as a callback of with-animation instead, + ;; once this issue has been resolved (timer/set-timeout on-expanded animation-delay)) (do (reanimated/set-shared-value @@ -197,9 +197,9 @@ (with-animation (+ bg-height (.-value pan-y)))) ;; Workaround for ;; https://github.com/software-mansion/react-native-reanimated/issues/1758#issue-817145741 - ;; withTiming/withSpring callback not working on-collapsed should - ;; be called as a callback of with-animation instead, once this - ;; issue has been resolved + ;; withTiming/withSpring callback not working on-collapsed + ;; should be called as a callback of with-animation instead, + ;; once this issue has been resolved (timer/set-timeout on-collapsed animation-delay))) (= @show-bottom-sheet? false) diff --git a/src/legacy/status_im/chat/models/loading.cljs b/src/legacy/status_im/chat/models/loading.cljs index e98a6220a85e..d0d33937b3c2 100644 --- a/src/legacy/status_im/chat/models/loading.cljs +++ b/src/legacy/status_im/chat/models/loading.cljs @@ -120,12 +120,13 @@ {:keys [message-id from] :as message}] (let [message - ;; For example, when a user receives a list of 4 image messages while inside - ;; the chat screen we shouldn't group the images into albums. When the user - ;; exists the chat screen then enters the chat screen again, we now need to - ;; group the images into albums (like WhatsApp). The albumize? boolean is used - ;; to know whether we need to group these images into albums now or not. The - ;; album-id can't be used for this because it will always be there. + ;; For example, when a user receives a list of 4 image messages while + ;; inside the chat screen we shouldn't group the images into albums. When + ;; the user exists the chat screen then enters the chat screen again, we + ;; now need to group the images into albums (like WhatsApp). The albumize? + ;; boolean is used to know whether we need to group these images into + ;; albums now or not. The album-id can't be used for this because it will + ;; always be there. (if (and (:album-id message) (nil? (get all-messages message-id))) (assoc message :albumize? true) message)] diff --git a/src/legacy/status_im/chat/models/message_test.cljs b/src/legacy/status_im/chat/models/message_test.cljs index dd0f994c76c7..09e2c9974aae 100644 --- a/src/legacy/status_im/chat/models/message_test.cljs +++ b/src/legacy/status_im/chat/models/message_test.cljs @@ -22,9 +22,7 @@ :alias "alias" :name "name" :from "from"}] - ;; <- cursor - ;; <- message - ;; <- top of the chat + ;; <- cursor <- message <- top of the chat (testing "there's no hidden item" (with-redefs [list.state/first-not-visible-item (atom nil)] (is @@ -41,10 +39,7 @@ cofx #js {:messages (to-array [message])}) :utils/dispatch-later))))) - ;; <- cursor - ;; <- first-hidden-item - ;; <- message - ;; <- top of the chat + ;; <- cursor <- first-hidden-item <- message <- top of the chat (testing "the hidden item has a clock value less than the current" (with-redefs [list.state/first-not-visible-item (atom {:clock-value (dec clock-value)})] (is @@ -61,10 +56,7 @@ cofx #js {:messages (to-array [message])}) :utils/dispatch-later))))) - ;; <- cursor - ;; <- message - ;; <- first-hidden-item - ;; <- top of the chat + ;; <- cursor <- message <- first-hidden-item <- top of the chat (testing "the message falls between the first-hidden-item and cursor" (with-redefs [list.state/first-not-visible-item (atom {:clock-value (inc clock-value)})] (let [result (dissoc (message/receive-many @@ -77,9 +69,7 @@ (is (= clock-value (get-in result [:db :pagination-info chat-id :cursor-clock-value]))) (is (= (loading/clock-value->cursor clock-value) (get-in result [:db :pagination-info chat-id :cursor]))))))) - ;; <- message - ;; <- first-hidden-item - ;; <- top of the chat + ;; <- message <- first-hidden-item <- top of the chat (testing "the message falls between the first-hidden-item and cursor is nil" (with-redefs [list.state/first-not-visible-item (atom {:clock-value (inc clock-value)})] (let [result (dissoc (message/receive-many @@ -96,10 +86,7 @@ (is (= clock-value (get-in result [:db :pagination-info chat-id :cursor-clock-value]))) (is (= (loading/clock-value->cursor clock-value) (get-in result [:db :pagination-info chat-id :cursor]))))))) - ;; <- message - ;; <- cursor - ;; <- first-hidden-item - ;; <- top of the chat + ;; <- message <- cursor <- first-hidden-item <- top of the chat (testing "the message falls before both the first-hidden-item and cursor" (with-redefs [list.state/first-not-visible-item (atom {:clock-value (inc clock-value)})] (let [message #js diff --git a/src/legacy/status_im/ens/core.cljs b/src/legacy/status_im/ens/core.cljs index cd79a620ee4a..d10a5e181b35 100644 --- a/src/legacy/status_im/ens/core.cljs +++ b/src/legacy/status_im/ens/core.cljs @@ -56,8 +56,7 @@ (rf/defn redirect-to-ens-summary {:events [::redirect-to-ens-summary]} [cofx] - ;; we reset navigation so that navigate back doesn't return - ;; into the registration flow + ;; we reset navigation so that navigate back doesn't return into the registration flow (rf/merge cofx (navigation/navigate-back-to :my-profile) (navigation/navigate-to :ens-confirmation {}))) @@ -161,8 +160,8 @@ (and (= response utils.ens/default-address) (not custom-domain?)) (re-frame/dispatch [::name-resolved username :available]) - ;; if we get an address back, we try to get the public key associated - ;; with the username as well + ;; if we get an address back, we try to get the public key associated with the username as + ;; well (get addresses (eip55/address->checksum response)) (ens/pubkey chain-id @@ -271,8 +270,7 @@ (rf/merge cofx ;; clear registration data {:db (dissoc db :ens/registration)} - ;; we reset navigation so that navigate back doesn't return - ;; into the registration flow + ;; we reset navigation so that navigate back doesn't return into the registration flow (navigation/navigate-back-to :my-profile) (navigation/navigate-to :ens-main {}))) diff --git a/src/legacy/status_im/keycard/fx.cljs b/src/legacy/status_im/keycard/fx.cljs index 99b09d8beacc..ace6932eac67 100644 --- a/src/legacy/status_im/keycard/fx.cljs +++ b/src/legacy/status_im/keycard/fx.cljs @@ -184,8 +184,8 @@ ;; TODO: Should act differently on different views (re-frame/reg-fx :keycard/listen-to-hardware-back-button - ;;NOTE: not done in view because effect should happen under different conditions and is not dependent on - ;;particular screen to be loaded. An fx is easier to re-use and test. + ;;NOTE: not done in view because effect should happen under different conditions and is not + ;;dependent on particular screen to be loaded. An fx is easier to re-use and test. (fn [] (re-frame/dispatch [:keycard/add-listener-to-hardware-back-button (.addEventListener BackHandler diff --git a/src/legacy/status_im/popover/core.cljs b/src/legacy/status_im/popover/core.cljs index ee6c6de0b1b4..c9fc60c70a08 100644 --- a/src/legacy/status_im/popover/core.cljs +++ b/src/legacy/status_im/popover/core.cljs @@ -8,8 +8,8 @@ (let [delay-ms (or (:delay-ms value) 250) value (dissoc value :delay-ms)] {:show-popover nil - ;; We should probably refactor to start the animation on mount, so that the - ;; delay can be removed. See comment for more details: + ;; We should probably refactor to start the animation on mount, so that the delay can be + ;; removed. See comment for more details: ;; https://github.com/status-im/status-mobile/pull/15222#issuecomment-1450162137 :dispatch-later [{:ms delay-ms :dispatch [:show-popover-db value]}] :dismiss-keyboard nil})) diff --git a/src/legacy/status_im/ui/components/action_sheet.cljs b/src/legacy/status_im/ui/components/action_sheet.cljs index a4eca2ee2312..76ae3c33131d 100644 --- a/src/legacy/status_im/ui/components/action_sheet.cljs +++ b/src/legacy/status_im/ui/components/action_sheet.cljs @@ -15,8 +15,8 @@ (defn- prepare-options [title message options] - (let [destructive-opt-index (utils/first-index :destructive? options)] ;; TODO Can only be a single - ;; destructive? + (let [destructive-opt-index (utils/first-index :destructive? options)] ;; TODO Can only be a + ;; single destructive? (clj->js (merge {:options (conj (mapv :label options) (i18n/label :t/cancel)) :cancelButtonIndex (count options)} (when destructive-opt-index diff --git a/src/legacy/status_im/ui/components/colors.cljs b/src/legacy/status_im/ui/components/colors.cljs index 137cf2c32605..c5f5875e262e 100644 --- a/src/legacy/status_im/ui/components/colors.cljs +++ b/src/legacy/status_im/ui/components/colors.cljs @@ -22,13 +22,15 @@ {:positive-01 "rgba(68,208,88,1)" ; Primary Positive, text, icons color :positive-02 "rgba(78,188,96,0.1)" ; Secondary Positive, Supporting color for success ; illustrations - :positive-03 "rgba(78,188,96,1)" ; Lighter Positive, Supporting color for success illustrations + :positive-03 "rgba(78,188,96,1)" ; Lighter Positive, Supporting color for success + ; illustrations :negative-01 "rgba(255,45,85,1)" ; Primary Negative, text, icons color :negative-02 "rgba(255,45,85,0.1))" ; Secondary Negative, Supporting color for errors ; illustrations :warning-01 "rgba(255, 202, 15, 1)" :warning-02 "rgba(255, 202, 15, 0.1)" - :interactive-01 "rgba(67,96,223,1)" ; Accent color, buttons, own message, actions,active state + :interactive-01 "rgba(67,96,223,1)" ; Accent color, buttons, own message, actions,active + ; state :interactive-02 "rgba(236,239,252,1)" ; Light Accent, buttons background, actions background, ; messages :interactive-03 "rgba(255,255,255,0.1)" ; Background for interactive above accent @@ -130,12 +132,14 @@ (def mentioned-background (:mentioned-background old-colors-mapping-light)) (def mentioned-border (:mentioned-border old-colors-mapping-light)) -(def red-light "#ffe5ea") ;; error tooltip TODO (andrey) should be white, but shadow needed +(def red-light "#ffe5ea") ;; error tooltip TODO (andrey) should be white, but shadow + ;; needed ;; BLACK (def black (:text-01 light-theme)) ;; Used as the default text color (def black-persist (:ui-background dark-theme)) ;; this doesn't with theme -(def black-transparent (:ui-02 light-theme)) ;; Used as background color for rounded button on dark background and as background +(def black-transparent (:ui-02 light-theme)) ;; Used as background color for rounded button on dark background and as + ;; background ;; color for containers like "Backup recovery phrase" (def black-transparent-20 (:backdrop light-theme)) ; accounts divider (def black-transparent-40 (:backdrop light-theme)) @@ -145,7 +149,8 @@ (def black-transparent-86 (:ui-03 light-theme)) ;; DARK GREY -(def gray (:text-02 light-theme)) ;; Dark grey, used as a background for a light foreground and as +(def gray (:text-02 light-theme)) ;; Dark grey, used as a background for a light foreground and + ;; as ;; section header and secondary text color (def gray-transparent-10 (alpha gray 0.1)) (def gray-transparent-40 (alpha gray 0.4)) @@ -153,7 +158,8 @@ (def gray-lighter (:ui-01 light-theme)) ;; Light Grey, used as a background or shadow ;; ACCENT BLUE -(def blue (:interactive-01 light-theme)) ;; Accent blue, used as main wallet color, and ios home add button +(def blue (:interactive-01 light-theme)) ;; Accent blue, used as main wallet color, and ios home add + ;; button (def blue-persist (:interactive-01 light-theme)) ;; LIGHT BLUE (def blue-light (:interactive-02 light-theme)) ;; Light Blue diff --git a/src/legacy/status_im/ui/components/list/item.cljs b/src/legacy/status_im/ui/components/list/item.cljs index e7c836c7fee2..4db1ead115d8 100644 --- a/src/legacy/status_im/ui/components/list/item.cljs +++ b/src/legacy/status_im/ui/components/list/item.cljs @@ -100,8 +100,8 @@ (and title subtitle) [:<> - ;; FIXME(Ferossgp): ReactNative 63 will support view inside text on andrid, remove thess if when - ;; migrating + ;; FIXME(Ferossgp): ReactNative 63 will support view inside text on andrid, remove thess if + ;; when migrating (if (string? title) [text/text {:weight (or title-text-weight :medium) @@ -179,13 +179,13 @@ {:style (merge {:align-items :center :justify-content :flex-end :flex-direction :row - ;; Grow to occupy full space, shrink when need be, but always maitaining 16px left - ;; gutter + ;; Grow to occupy full space, shrink when need be, but always maitaining 16px + ;; left gutter :flex-grow 1 :flex-shrink 0 :margin-left 16 - ;; When the left-side leaves no room for right-side, the rendered element is pushed - ;; out. A flex-basis ensures that there is some room reserved. + ;; When the left-side leaves no room for right-side, the rendered element is + ;; pushed out. A flex-basis ensures that there is some room reserved. ;; The number 80px was determined by trial and error. :flex-basis 80} accessory-style)} diff --git a/src/legacy/status_im/ui/components/text_input.cljs b/src/legacy/status_im/ui/components/text_input.cljs index fab1065edc54..e47883c64b3d 100644 --- a/src/legacy/status_im/ui/components/text_input.cljs +++ b/src/legacy/status_im/ui/components/text_input.cljs @@ -188,8 +188,8 @@ :on-press #(reset! visible true)} :else after) - secure (boolean (and secure-text-entry (not @visible))) ; must be a boolean to work on - ; iOS + secure (boolean (and secure-text-entry (not @visible))) ; must be a boolean to + ; work on iOS auto-complete (cond (= keyboard-type :visible-password) :off @@ -211,8 +211,7 @@ :default ; the correct approach on Android would be keep secure-text-entry on set - ; keyboard type - ; to visible-password. But until + ; keyboard type to visible-password. But until ; https://github.com/facebook/react-native/issues/27946 ; is solved that's the second best way. (and platform/android? secure-text-entry) diff --git a/src/legacy/status_im/ui/components/topbar.cljs b/src/legacy/status_im/ui/components/topbar.cljs index b1478aa861b6..d8543b076754 100644 --- a/src/legacy/status_im/ui/components/topbar.cljs +++ b/src/legacy/status_im/ui/components/topbar.cljs @@ -26,8 +26,9 @@ (defn topbar [{:keys [navigation use-insets right-accessories modal? content border-bottom? new-ui?] ;; remove - ;; new-ui? key, - ;; temp fix + ;; new-ui? + ;; key, temp + ;; fix :or {border-bottom? true new-ui? false} :as props}] diff --git a/src/legacy/status_im/ui/screens/browser/permissions/views.cljs b/src/legacy/status_im/ui/screens/browser/permissions/views.cljs index 530151c1e904..8bb7b86c065b 100644 --- a/src/legacy/status_im/ui/screens/browser/permissions/views.cljs +++ b/src/legacy/status_im/ui/screens/browser/permissions/views.cljs @@ -50,18 +50,17 @@ {:UNSAFE_componentWillUpdate (fn [_ [_ _ {:keys [requested-permission]}]] (cond @update? - ;; the component has been updated with a new permission, we show the - ;; panel + ;; the component has been updated with a new permission, we + ;; show the panel (do (reset! update? false) (show-panel-anim bottom-anim-value alpha-value)) (and @current-permission requested-permission) - ;; a permission has been accepted/denied by the user, and there is - ;; another permission that needs to be processed by the user - ;; we hide the processed permission with an animation and update - ;; `current-permission` with a delay so that the information is - ;; still - ;; available during the animation + ;; a permission has been accepted/denied by the user, and there + ;; is another permission that needs to be processed by the user + ;; we hide the processed permission with an animation and + ;; update `current-permission` with a delay so that the + ;; information is still available during the animation (do (reset! update? true) (js/setTimeout #(reset! current-permission (permission-details requested-permission)) @@ -70,20 +69,18 @@ requested-permission ;; the dapp is asking for a permission, we put it in - ;; current-permission - ;; and start the show-animation + ;; current-permission and start the show-animation (do (reset! current-permission (get browser.permissions/supported-permissions requested-permission)) (show-panel-anim bottom-anim-value alpha-value)) :else - ;; a permission has been accepted/denied by the user, and there is - ;; no other permission that needs to be processed by the user - ;; we hide the processed permission with an animation and update - ;; `current-permission` with a delay so that the information is - ;; still - ;; available during the animation + ;; a permission has been accepted/denied by the user, and there + ;; is no other permission that needs to be processed by the + ;; user we hide the processed permission with an animation and + ;; update `current-permission` with a delay so that the + ;; information is still available during the animation (do (js/setTimeout #(reset! current-permission nil) 500) (hide-panel-anim bottom-anim-value alpha-value))))} (when @current-permission diff --git a/src/legacy/status_im/ui/screens/reset_password/views.cljs b/src/legacy/status_im/ui/screens/reset_password/views.cljs index a75bcf1bb619..16f5edb0f054 100644 --- a/src/legacy/status_im/ui/screens/reset_password/views.cljs +++ b/src/legacy/status_im/ui/screens/reset_password/views.cljs @@ -78,8 +78,8 @@ {:on-press on-submit :accessibility-label :next-button :disabled (or (not next-enabled?) - ;; disable on resetting? so the user cannot press the next button - ;; recklessly + ;; disable on resetting? so the user cannot press the next + ;; button recklessly ;; https://github.com/status-im/status-mobile/pull/12245#issuecomment-874827573 resetting?) :type :secondary diff --git a/src/legacy/status_im/utils/random_test.cljs b/src/legacy/status_im/utils/random_test.cljs index a1da0d7157ec..fd411c4e6da8 100644 --- a/src/legacy/status_im/utils/random_test.cljs +++ b/src/legacy/status_im/utils/random_test.cljs @@ -49,9 +49,8 @@ (is (empty? (filter #(< % 0) sample))) ;no result should be larger than n (is (empty? (filter #(>= % n) sample))) - ;and while there is a very small probability - ;it is very unlikely and probably wrong if all 1000 calls - ;got us the same number. + ;and while there is a very small probability it is very unlikely and probably wrong if all 1000 + ;calls got us the same number. (is (> (count sample) 1)))) (deftest test-seeded-rand-nth diff --git a/src/quo/components/animated_header_flatlist/view.cljs b/src/quo/components/animated_header_flatlist/view.cljs index cda1cc5fa536..17920a318db1 100644 --- a/src/quo/components/animated_header_flatlist/view.cljs +++ b/src/quo/components/animated_header_flatlist/view.cljs @@ -57,7 +57,8 @@ (let [theme (quo.theme/use-theme-value) window-height (:height (rn/get-window)) {:keys [top bottom]} (safe-area/get-insets) - ;; view height calculation is different because window height is different on iOS and Android: + ;; view height calculation is different because window height is different on iOS and + ;; Android: view-height (if platform/ios? (- window-height bottom) (+ window-height top)) diff --git a/src/quo/components/avatars/user_avatar/view.cljs b/src/quo/components/avatars/user_avatar/view.cljs index 877e6177a5d4..f708696ab2af 100644 --- a/src/quo/components/avatars/user_avatar/view.cljs +++ b/src/quo/components/avatars/user_avatar/view.cljs @@ -54,9 +54,8 @@ [rn/view {:style outer-styles :accessibility-label :user-avatar} (if (and full-name (not (or profile-picture-fn profile-picture))) - ;; this is for things that's not user-avatar - ;; but are currently using user-avatar to render the initials - ;; e.g. community avatar + ;; this is for things that's not user-avatar but are currently using user-avatar to render + ;; the initials e.g. community avatar [initials-avatar props] [image-view {:accessibility-label :profile-picture diff --git a/src/quo/components/gradient/gradient_cover/view.cljs b/src/quo/components/gradient/gradient_cover/view.cljs index 2fd86951fd40..dce2e71e8514 100644 --- a/src/quo/components/gradient/gradient_cover/view.cljs +++ b/src/quo/components/gradient/gradient_cover/view.cljs @@ -8,10 +8,9 @@ (defn- view-internal [{:keys [customization-color opacity container-style height] :or {customization-color :blue}}] - ;; `when` added for safety, `linear-gradient` will break if `nil` is passed, - ;; the `:or` destructuring won't work because it's only applied when the - ;; `:customization-color` key is non-existent. While deleting an account the key exists - ;; and has a `nil` value. + ;; `when` added for safety, `linear-gradient` will break if `nil` is passed, the `:or` + ;; destructuring won't work because it's only applied when the `:customization-color` key is + ;; non-existent. While deleting an account the key exists and has a `nil` value. (when customization-color (let [color-top (colors/resolve-color customization-color 50 20) color-bottom (colors/resolve-color customization-color 50 0)] diff --git a/src/quo/components/graph/utils_test.cljs b/src/quo/components/graph/utils_test.cljs index f59bac54447a..12ea0cf15131 100644 --- a/src/quo/components/graph/utils_test.cljs +++ b/src/quo/components/graph/utils_test.cljs @@ -73,7 +73,8 @@ (testing "Downsampling works with large input data and max-array-size (randomized test)" (let [large-data (range 1000) max-array-size 500 - expected-output (range 0 1000 2)] ; expected-output contains every 2nd element from 0 to 1000 + expected-output (range 0 1000 2)] ; expected-output contains every 2nd element from 0 to + ; 1000 (is (= (utils/downsample-data large-data max-array-size) expected-output))))) (deftest format-compact-number diff --git a/src/quo/components/navigation/bottom_nav_tab/view.cljs b/src/quo/components/navigation/bottom_nav_tab/view.cljs index 0f0044a5a7e3..723eb13d233e 100644 --- a/src/quo/components/navigation/bottom_nav_tab/view.cljs +++ b/src/quo/components/navigation/bottom_nav_tab/view.cljs @@ -55,12 +55,10 @@ :accessibility-label accessibility-label} [reanimated/view {:style background-animated-style} ;; In android animations are not working for the animated components which are nested by - ;; hole-view, - ;; Interestingly this only happens when hole view and blur view are used together + ;; hole-view,. Interestingly this only happens when hole view and blur view are used together ;; Similar behavior is also seen while removing holes, and to fix that we used key and - ;; force-rendered view - ;; But we need animations faster for tab clicks, so we can't rely on reagent atoms, - ;; so for now only using hole view for the ios tab icon notification boundary + ;; force-rendered view. But we need animations faster for tab clicks, so we can't rely on + ;; reagent atoms, so for now only using hole view for the ios tab icon notification boundary (if platform/ios? [hole-view/hole-view {:key new-notifications? ;; Key is required to force removal of holes diff --git a/src/quo/components/navigation/top_nav/style.cljs b/src/quo/components/navigation/top_nav/style.cljs index afecb61a3689..e877c95d13af 100644 --- a/src/quo/components/navigation/top_nav/style.cljs +++ b/src/quo/components/navigation/top_nav/style.cljs @@ -5,8 +5,7 @@ (let [right-offset (cond (> unread-count max-value) -14 - ;; Greater than 9 means we'll need 2 digits to represent - ;; the text. + ;; Greater than 9 means we'll need 2 digits to represent the text. (> unread-count 9) -10 :else -6)] diff --git a/src/quo/components/record_audio/record_audio/buttons/record_button_big.cljs b/src/quo/components/record_audio/record_audio/buttons/record_button_big.cljs index 80dd511a97a1..2254a36495f6 100644 --- a/src/quo/components/record_audio/record_audio/buttons/record_button_big.cljs +++ b/src/quo/components/record_audio/record_audio/buttons/record_button_big.cljs @@ -98,9 +98,8 @@ (fn [] (helpers/set-value opacity 1) (helpers/animate-linear scale 2.6 signal-anim-duration) - ;; TODO: Research if we can implement this with withSequence method - ;; from Reanimated 2 - ;; GitHub issue [#14561]: + ;; TODO: Research if we can implement this with withSequence method from + ;; Reanimated 2. GitHub issue [#14561]: ;; https://github.com/status-im/status-mobile/issues/14561 (reset! clear-timeout (js/setTimeout diff --git a/src/react_native/keychain.cljs b/src/react_native/keychain.cljs index aa904f5deea8..2b900fd03a19 100644 --- a/src/react_native/keychain.cljs +++ b/src/react_native/keychain.cljs @@ -20,24 +20,20 @@ ;; see this article for more details: ;; https://developer.apple.com/documentation/security/keychain_services/keychain_items/restricting_keychain_item_accessibility?language=objc (def keychain-restricted-availability - ;; From Apple's documentation: - ;; > The kSecAttrAccessible attribute enables you to control item availability - ;; > relative to the lock state of the device. - ;; > It also lets you specify eligibility for restoration to a new device. - ;; > If the attribute ends with the string ThisDeviceOnly, - ;; > the item can be restored to the same device that created a backup, - ;; > but it isn’t migrated when restoring another device’s backup data. - ;; > ... - ;; > For extremely sensitive data - ;; > THAT YOU NEVER WANT STORED IN iCloud, - ;; > you might choose kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly. - ;; That is exactly what we use there. - ;; Note that the password won't be stored if the device isn't locked by a passcode. + ;; From Apple's documentation: > The kSecAttrAccessible attribute enables you to control item + ;; availability > relative to the lock state of the device. > It also lets you specify eligibility + ;; for restoration to a new device. > If the attribute ends with the string ThisDeviceOnly, > the + ;; item can be restored to the same device that created a backup, > but it isn’t migrated when + ;; restoring another device’s backup data. > ... > For extremely sensitive data > THAT YOU NEVER + ;; WANT STORED IN iCloud, > you might choose kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly. That + ;; is exactly what we use there. Note that the password won't be stored if the device isn't locked + ;; by a passcode. #js {:accessible (enum-val "ACCESSIBLE" "WHEN_PASSCODE_SET_THIS_DEVICE_ONLY")}) (def keychain-secure-hardware ;; (Android) Requires storing the encryption key for the entry in secure hardware - ;; or StrongBox (see https://developer.android.com/training/articles/keystore#ExtractionPrevention) + ;; or StrongBox (see + ;; https://developer.android.com/training/articles/keystore#ExtractionPrevention) #js {:accessible (enum-val "SECURITY_LEVEL" "SECURE_HARDWARE")}) ;; Android only diff --git a/src/status_im/common/scan_qr_code/view.cljs b/src/status_im/common/scan_qr_code/view.cljs index 80a72e80c923..3af38d4ca8cd 100644 --- a/src/status_im/common/scan_qr_code/view.cljs +++ b/src/status_im/common/scan_qr_code/view.cljs @@ -132,8 +132,8 @@ [{:keys [event error-message validate-fn on-success-scan on-failed-scan scan-code?]}] (let [scanned-value (string/trim (oops/oget event "nativeEvent.codeStringValue")) validated? (if validate-fn (validate-fn scanned-value) true)] - ;; Note - camera-kit keeps scanning until the screen is dismissed, - ;; so disable scanning to make sure the on-read-code doesn't get executed multiple times + ;; Note - camera-kit keeps scanning until the screen is dismissed, so disable scanning to make + ;; sure the on-read-code doesn't get executed multiple times (reset! scan-code? false) (if validated? (on-success-scan scanned-value) diff --git a/src/status_im/contexts/chat/messenger/composer/selection.cljs b/src/status_im/contexts/chat/messenger/composer/selection.cljs index 5da373191929..bcf872420bb7 100644 --- a/src/status_im/contexts/chat/messenger/composer/selection.cljs +++ b/src/status_im/contexts/chat/messenger/composer/selection.cljs @@ -24,7 +24,8 @@ [text-input-handle selection-start selection-end] ;; to avoid something like this ;; https://lightrun.com/answers/facebook-react-native-textinput-controlled-selection-broken-on-both-ios-and-android - ;; use native invoke instead! do not use setNativeProps! e.g. (.setNativeProps ^js text-input (clj->js + ;; use native invoke instead! do not use setNativeProps! e.g. (.setNativeProps ^js text-input + ;; (clj->js ;; {:selection {:start selection-start :end selection-end}})) (let [manager (rn/selectable-text-input-manager)] (oops/ocall manager :setSelection text-input-handle selection-start selection-end))) diff --git a/src/status_im/contexts/chat/messenger/messages/content/deleted/view.cljs b/src/status_im/contexts/chat/messenger/messages/content/deleted/view.cljs index b4ac29012269..5b10c1ad8583 100644 --- a/src/status_im/contexts/chat/messenger/messages/content/deleted/view.cljs +++ b/src/status_im/contexts/chat/messenger/messages/content/deleted/view.cljs @@ -57,8 +57,7 @@ animation-duration (when-let [deleted-till (or deleted-undoable-till deleted-for-me-undoable-till)] (- deleted-till (datetime/timestamp))) - ;; enable long press only when - ;; undo delete timer timedout + ;; enable long press only when undo delete timer timedout ;; message pinned and user has permission to unpin on-long-press (when (and (not animation-duration) (or (and (or in-pinned-view? pinned) message-pin-enabled) diff --git a/src/status_im/contexts/profile/contact/add_nickname/view.cljs b/src/status_im/contexts/profile/contact/add_nickname/view.cljs index 8441bd019569..df538c142bc3 100644 --- a/src/status_im/contexts/profile/contact/add_nickname/view.cljs +++ b/src/status_im/contexts/profile/contact/add_nickname/view.cljs @@ -14,7 +14,8 @@ [] (let [{:keys [public-key primary-name nickname customization-color] :as profile} (rf/sub [:contacts/current-contact]) - ;; TODO(@mohsen): remove default color, https://github.com/status-im/status-mobile/issues/18733 + ;; TODO(@mohsen): remove default color, + ;; https://github.com/status-im/status-mobile/issues/18733 customization-color (or customization-color constants/profile-default-color) full-name (profile.utils/displayed-name profile) profile-picture (profile.utils/photo profile) diff --git a/src/status_im/contexts/profile/contact/block_contact/view.cljs b/src/status_im/contexts/profile/contact/block_contact/view.cljs index 76b350ff5a8a..636d5f377425 100644 --- a/src/status_im/contexts/profile/contact/block_contact/view.cljs +++ b/src/status_im/contexts/profile/contact/block_contact/view.cljs @@ -13,7 +13,8 @@ [] (let [{:keys [customization-color contact-request-state public-key] :as contact} (rf/sub [:contacts/current-contact]) - ;; TODO(@mohsen): remove default color, https://github.com/status-im/status-mobile/issues/18733 + ;; TODO(@mohsen): remove default color, + ;; https://github.com/status-im/status-mobile/issues/18733 customization-color (or customization-color constants/profile-default-color) full-name (profile.utils/displayed-name contact) profile-picture (profile.utils/photo contact) diff --git a/src/status_im/contexts/profile/contact/header/view.cljs b/src/status_im/contexts/profile/contact/header/view.cljs index ec5751f459e7..23c03848c364 100644 --- a/src/status_im/contexts/profile/contact/header/view.cljs +++ b/src/status_im/contexts/profile/contact/header/view.cljs @@ -29,7 +29,8 @@ (let [{:keys [public-key customization-color ens-name nickname secondary-name emoji-hash bio blocked? contact-request-state] :as contact} (rf/sub [:contacts/current-contact]) - ;; TODO(@mohsen): remove default color, https://github.com/status-im/status-mobile/issues/18733 + ;; TODO(@mohsen): remove default color, + ;; https://github.com/status-im/status-mobile/issues/18733 customization-color (or customization-color constants/profile-default-color) full-name (profile.utils/displayed-name contact) profile-picture (profile.utils/photo contact) diff --git a/src/status_im/contexts/profile/contact/view.cljs b/src/status_im/contexts/profile/contact/view.cljs index 10ca3551d0f8..541aecf3c439 100644 --- a/src/status_im/contexts/profile/contact/view.cljs +++ b/src/status_im/contexts/profile/contact/view.cljs @@ -32,7 +32,8 @@ {:navigate-back? true :height 148 :on-scroll #(reanimated/set-shared-value scroll-y %) - ;; TODO(@mohsen): remove default color, https://github.com/status-im/status-mobile/issues/18733 + ;; TODO(@mohsen): remove default color, + ;; https://github.com/status-im/status-mobile/issues/18733 :cover-color (colors/resolve-color (or customization-color constants/profile-default-color) theme 20) diff --git a/src/status_im/contexts/profile/utils.cljs b/src/status_im/contexts/profile/utils.cljs index 9d6ce859d2a0..f8ca89994d5e 100644 --- a/src/status_im/contexts/profile/utils.cljs +++ b/src/status_im/contexts/profile/utils.cljs @@ -3,8 +3,7 @@ (defn displayed-name [{:keys [name display-name preferred-name alias ens-verified primary-name]}] - ;; `preferred-name` is our own name - ;; otherwise we make sure the `name` is verified and use it + ;; `preferred-name` is our own name otherwise we make sure the `name` is verified and use it (let [display-name (when-not (string/blank? display-name) display-name) preferred-name (when-not (string/blank? preferred-name) diff --git a/src/status_im/contexts/shell/activity_center/notification/contact_verification/view.cljs b/src/status_im/contexts/shell/activity_center/notification/contact_verification/view.cljs index 1b091ff1a321..cb3a2827e986 100644 --- a/src/status_im/contexts/shell/activity_center/notification/contact_verification/view.cljs +++ b/src/status_im/contexts/shell/activity_center/notification/contact_verification/view.cljs @@ -158,9 +158,8 @@ (let [{:keys [id message contact-verification-status]} notification challenger? (:outgoing message)] - ;; TODO(@ilmotta): Declined challenges should only be displayed for the - ;; challengee, not the challenger. - ;; https://github.com/status-im/status-mobile/issues/14354 + ;; TODO(@ilmotta): Declined challenges should only be displayed for the challengee, not the + ;; challenger. Https://github.com/status-im/status-mobile/issues/14354 (when-not (and challenger? (= contact-verification-status constants/contact-verification-status-declined)) diff --git a/src/status_im/contexts/shell/jump_to/components/floating_screens/style.cljs b/src/status_im/contexts/shell/jump_to/components/floating_screens/style.cljs index ef24410e4cb4..77eb30cdd125 100644 --- a/src/status_im/contexts/shell/jump_to/components/floating_screens/style.cljs +++ b/src/status_im/contexts/shell/jump_to/components/floating_screens/style.cljs @@ -16,11 +16,10 @@ :z-index screen-z-index} {:background-color (colors/theme-colors colors/white colors/neutral-95 theme) :overflow :hidden - ;; KeyboardAvoidingView which is used for chat screen composer, - ;; not working when we use :absolute layout. One fix is to add - ;; KeyboardAvoidingView :behaviour height in android, which is also - ;; recommended in the documentation. It fixes KeyboardAvoidingView but - ;; the pushing of views by the keyboard is not smooth & while animating it creates a weird jump. + ;; KeyboardAvoidingView which is used for chat screen composer, not working when we use + ;; :absolute layout. One fix is to add. KeyboardAvoidingView :behaviour height in android, which + ;; is also recommended in the documentation. It fixes KeyboardAvoidingView but the pushing of + ;; views by the keyboard is not smooth & while animating it creates a weird jump. :position (if (= screen-id shell.constants/chat-screen) :relative :absolute) :flex -1})) diff --git a/src/status_im/subs/shell.cljs b/src/status_im/subs/shell.cljs index 42a6a737177f..f4e526c305bf 100644 --- a/src/status_im/subs/shell.cljs +++ b/src/status_im/subs/shell.cljs @@ -40,8 +40,7 @@ {:content-type constants/content-type-text :data content} - ;; Currently mock image is used as placeholder, - ;; as last-message don't have image + ;; Currently mock image is used as placeholder, as last-message don't have image ;; https://github.com/status-im/status-mobile/issues/14625 (= content-type constants/content-type-image) {:content-type constants/content-type-image @@ -234,7 +233,8 @@ (and (not muted) (= chat-type constants/one-to-one-chat-type)) - ;; Note - for 1-1 chats, all unread messages are counted as mentions and shown with counter + ;; Note - for 1-1 chats, all unread messages are counted as mentions and shown with + ;; counter (-> acc (update-in [:chats-stack :unviewed-messages-count] + unviewed-messages-count) (update-in [:chats-stack :unviewed-mentions-count] + unviewed-messages-count))