From de3c08ba185d348c797f3fd87a2213982d5900c3 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Tue, 21 Dec 2021 13:23:55 +0200 Subject: [PATCH] Add sync history for 2 mins option for testing purposes --- .env | 1 + .env.e2e | 1 + .env.jenkins | 1 + src/status_im/constants.cljs | 1 + .../ui/screens/default_sync_period_settings/view.cljs | 6 +++++- src/status_im/ui/screens/sync_settings/views.cljs | 2 ++ src/status_im/utils/config.cljs | 1 + translations/en.json | 3 ++- 8 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 85d1f28826..558d337982 100644 --- a/.env +++ b/.env @@ -32,3 +32,4 @@ METRICS_ENABLED=0 DELETE_MESSAGE_ENABLED=1 COLLECTIBLES_ENABLED=1 COMMANDS_ENABLED=1 +TWO_MINUTES_SYNCING=1 diff --git a/.env.e2e b/.env.e2e index a9782b1757..aa5940d26e 100644 --- a/.env.e2e +++ b/.env.e2e @@ -33,3 +33,4 @@ COMMUNITIES_ENABLED=1 COMMUNITIES_MANAGEMENT_ENABLED=1 METRICS_ENABLED=0 DELETE_MESSAGE_ENABLED=1 +TWO_MINUTES_SYNCING=1 diff --git a/.env.jenkins b/.env.jenkins index abd7313280..dddcaa49d6 100644 --- a/.env.jenkins +++ b/.env.jenkins @@ -35,3 +35,4 @@ COMMUNITIES_ENABLED=1 COMMUNITIES_MANAGEMENT_ENABLED=1 METRICS_ENABLED=0 DELETE_MESSAGE_ENABLED=1 +TWO_MINUTES_SYNCING=1 diff --git a/src/status_im/constants.cljs b/src/status_im/constants.cljs index 520d272302..0e98f54047 100644 --- a/src/status_im/constants.cljs +++ b/src/status_im/constants.cljs @@ -146,6 +146,7 @@ (def ^:const timeline-chat-id "@timeline70bd746ddcc12beb96b2c9d572d0784ab137ffc774f5383e50585a932080b57cca0484b259e61cecbaa33a4c98a300a") +(def ^:const two-mins (* 2 60)) (def ^:const one-day (* 60 60 24)) (def ^:const three-days (* one-day 3)) (def ^:const one-week (* one-day 7)) diff --git a/src/status_im/ui/screens/default_sync_period_settings/view.cljs b/src/status_im/ui/screens/default_sync_period_settings/view.cljs index edc63e17b3..a712d43ec7 100644 --- a/src/status_im/ui/screens/default_sync_period_settings/view.cljs +++ b/src/status_im/ui/screens/default_sync_period_settings/view.cljs @@ -3,10 +3,12 @@ (:require [status-im.ui.components.react :as react] [status-im.i18n.i18n :as i18n] [status-im.constants :as constants] + [status-im.utils.config :as config] [quo.core :as quo] [re-frame.core :as re-frame])) -(def titles {constants/one-day (i18n/label :t/one-day) +(def titles {constants/two-mins (i18n/label :t/two-minutes) + constants/one-day (i18n/label :t/one-day) constants/three-days (i18n/label :t/three-days) constants/one-week (i18n/label :t/one-week) constants/one-month (i18n/label :t/one-month)}) @@ -21,6 +23,8 @@ (views/defview default-sync-period-settings [] (views/letsubs [{:keys [default-sync-period]} [:multiaccount]] [react/view {:margin-top 8} + (when config/two-minutes-syncing? + [radio-item constants/two-mins default-sync-period]) [radio-item constants/one-day default-sync-period] [radio-item constants/three-days default-sync-period] [radio-item constants/one-week default-sync-period] diff --git a/src/status_im/ui/screens/sync_settings/views.cljs b/src/status_im/ui/screens/sync_settings/views.cljs index a2ddd21546..cef003d64a 100644 --- a/src/status_im/ui/screens/sync_settings/views.cljs +++ b/src/status_im/ui/screens/sync_settings/views.cljs @@ -40,6 +40,8 @@ :chevron true :accessory :text :accessory-text (cond + (= default-sync-period constants/two-mins) + (i18n/label :t/two-minutes) (= default-sync-period constants/one-day) (i18n/label :t/one-day) (= default-sync-period constants/three-days) diff --git a/src/status_im/utils/config.cljs b/src/status_im/utils/config.cljs index 584258bf3c..a977bc0762 100644 --- a/src/status_im/utils/config.cljs +++ b/src/status_im/utils/config.cljs @@ -52,6 +52,7 @@ (def delete-message-enabled? (enabled? (get-config :DELETE_MESSAGE_ENABLED "0"))) (def collectibles-enabled? (enabled? (get-config :COLLECTIBLES_ENABLED "1"))) (def test-stateofus? (enabled? (get-config :TEST_STATEOFUS "0"))) +(def two-minutes-syncing? (enabled? (get-config :TWO_MINUTES_SYNCING "0"))) ;; CONFIG VALUES (def log-level diff --git a/translations/en.json b/translations/en.json index 1cc64a57c0..47c2bbc30d 100644 --- a/translations/en.json +++ b/translations/en.json @@ -1703,5 +1703,6 @@ "status-dnd-subtitle": "Mutes all notifications", "status-always-online": "Always Online", "status-inactive": "Inactive", - "status-inactive-subtitle": "Hides your online status" + "status-inactive-subtitle": "Hides your online status", + "two-minutes": "two minutes" }