diff --git a/src/status_im/constants.cljs b/src/status_im/constants.cljs index 20df181fec62..96664f212a80 100644 --- a/src/status_im/constants.cljs +++ b/src/status_im/constants.cljs @@ -80,7 +80,7 @@ (merge testnet-networks mainnet-networks sidechain-networks)) (def default-multiaccount-settings - {:preview-privacy? false + {:preview-privacy? true :wallet {:visible-tokens {}}}) (def currencies diff --git a/src/status_im/multiaccounts/core.cljs b/src/status_im/multiaccounts/core.cljs index 9c6ccfe7b016..dcbf26037e0a 100644 --- a/src/status_im/multiaccounts/core.cljs +++ b/src/status_im/multiaccounts/core.cljs @@ -139,3 +139,8 @@ (multiaccounts.update/update-settings (assoc settings :preview-privacy? private?) {})))) + +(fx/defn switch-preview-privacy-mode-flag + [{:keys [db]}] + (let [private? (get-in db [:multiaccount :settings :preview-privacy?])] + {::blank-preview-flag-changed private?})) diff --git a/src/status_im/multiaccounts/login/core.cljs b/src/status_im/multiaccounts/login/core.cljs index fb8e3bef2d5c..c5896a8a8953 100644 --- a/src/status_im/multiaccounts/login/core.cljs +++ b/src/status_im/multiaccounts/login/core.cljs @@ -33,7 +33,8 @@ [status-im.utils.identicon :as identicon] [status-im.ethereum.eip55 :as eip55] [status-im.popover.core :as popover] - [status-im.hardwallet.nfc :as nfc])) + [status-im.hardwallet.nfc :as nfc] + [status-im.multiaccounts.core :as multiaccounts])) (def rpc-endpoint "https://goerli.infura.io/v3/f315575765b14720b32382a61a89341a") (def contract-address "0xfbf4c8e2B41fAfF8c616a0E49Fb4365a5355Ffaf") @@ -177,7 +178,8 @@ (contact/initialize-contacts) (stickers/init-stickers-packs) (mobile-network/on-network-status-change) - (chaos-mode/check-chaos-mode)))) + (chaos-mode/check-chaos-mode) + (multiaccounts/switch-preview-privacy-mode-flag)))) (defn get-new-auth-method [auth-method save-password?] (if save-password? @@ -252,6 +254,7 @@ :mailserver-topics {} :default-mailserver true}) (chaos-mode/check-chaos-mode) + (multiaccounts/switch-preview-privacy-mode-flag) (when-not platform/desktop? (initialize-wallet nil))))) diff --git a/src/status_im/ui/screens/add_new/db.cljs b/src/status_im/ui/screens/add_new/db.cljs deleted file mode 100644 index 142547de64b1..000000000000 --- a/src/status_im/ui/screens/add_new/db.cljs +++ /dev/null @@ -1,5 +0,0 @@ -(ns status-im.ui.screens.add-new.db - (:require [cljs.spec.alpha :as spec] - status-im.contact.db)) - -(spec/def :new/open-dapp (spec/nilable :contact/contact)) diff --git a/src/status_im/ui/screens/add_new/events.cljs b/src/status_im/ui/screens/add_new/events.cljs deleted file mode 100644 index ff0372abdfb2..000000000000 --- a/src/status_im/ui/screens/add_new/events.cljs +++ /dev/null @@ -1,9 +0,0 @@ -(ns status-im.ui.screens.add-new.events - (:require [status-im.ui.screens.add-new.models :as models] - [status-im.utils.handlers :as handlers] - [taoensso.timbre :as log])) - -(handlers/register-handler-fx - :handle-qr-code - (fn [cofx [_ data _]] - (models/handle-qr-code cofx data))) diff --git a/src/status_im/ui/screens/add_new/models.cljs b/src/status_im/ui/screens/add_new/models.cljs deleted file mode 100644 index 7358e0b04877..000000000000 --- a/src/status_im/ui/screens/add_new/models.cljs +++ /dev/null @@ -1,20 +0,0 @@ -(ns status-im.ui.screens.add-new.models - (:require [cljs.spec.alpha :as spec] - [re-frame.core :as re-frame] - [status-im.i18n :as i18n] - [status-im.ui.screens.navigation :as navigation] - [status-im.utils.universal-links.core :as universal-links] - [status-im.utils.fx :as fx])) - -(fx/defn process-qr-code - [cofx data] - (if (spec/valid? :global/public-key data) - (universal-links/handle-view-profile cofx data) - (or (universal-links/handle-url cofx data) - {:utils/show-popup {:title (i18n/label :t/unable-to-read-this-code) - :content (i18n/label :t/use-valid-qr-code {:data data}) - :on-dismiss #(re-frame/dispatch [:navigate-to-clean :home])}}))) - -(fx/defn handle-qr-code - [cofx data] - (process-qr-code cofx data)) diff --git a/src/status_im/ui/screens/add_new/views.cljs b/src/status_im/ui/screens/add_new/views.cljs deleted file mode 100644 index eaeba49f4d0f..000000000000 --- a/src/status_im/ui/screens/add_new/views.cljs +++ /dev/null @@ -1,55 +0,0 @@ -(ns status-im.ui.screens.add-new.views - (:require [re-frame.core :as re-frame] - [status-im.i18n :as i18n] - [status-im.ui.components.common.common :as common] - [status-im.ui.components.list-selection :as list-selection] - [status-im.ui.components.react :as react] - [status-im.ui.components.toolbar.view :as toolbar] - [status-im.utils.platform :as platform] - [status-im.ui.components.list-item.views :as list-item])) - -(defn- options-list [] - [react/view {:flex 1} - [list-item/list-item - {:theme :action - :title (i18n/label :t/start-new-chat) - :accessibility-label :start-1-1-chat-button - :icon :main-icons/add-contact - :on-press #(re-frame/dispatch [:navigate-to :new-chat])}] - [common/list-separator] - [list-item/list-item - {:theme :action - :title (i18n/label :t/start-group-chat) - :accessibility-label :start-group-chat-button - :icon :main-icons/group-chat - :on-press #(re-frame/dispatch [:contact.ui/start-group-chat-pressed])}] - [common/list-separator] - [list-item/list-item - {:theme :action - :title (i18n/label :t/new-public-group-chat) - :accessibility-label :join-public-chat-button - :icon :main-icons/public-chat - :on-press #(re-frame/dispatch [:navigate-to :new-public-chat])}] - (when-not platform/desktop? - [common/list-separator] - [list-item/list-item - {:theme :action - :title (i18n/label :t/invite-friends) - :accessibility-label :invite-friends-button - :icon :main-icons/share - :on-press #(list-selection/open-share {:message (i18n/label :t/get-status-at)})}] - [common/list-separator] - [list-item/list-item - {:theme :action - :title (i18n/label :t/scan-qr) - :accessibility-label :scan-qr-code-button - :icon :main-icons/qr - :on-press #(re-frame/dispatch [:qr-scanner.ui/scan-qr-code-pressed - {:title (i18n/label :t/scan-qr) - :handler :handle-qr-code}])}])]) - -(defn add-new [] - [react/view {:flex 1 :background-color :white} - [toolbar/simple-toolbar (i18n/label :t/new)] - [common/separator] - [options-list]]) diff --git a/src/status_im/ui/screens/db.cljs b/src/status_im/ui/screens/db.cljs index ea7fff82f3f8..c071d3ff84df 100644 --- a/src/status_im/ui/screens/db.cljs +++ b/src/status_im/ui/screens/db.cljs @@ -13,7 +13,6 @@ status-im.mailserver.db status-im.ens.db status-im.browser.db - status-im.ui.screens.add-new.db status-im.ui.screens.add-new.new-public-chat.db status-im.ui.components.bottom-sheet.core [status-im.wallet.db :as wallet.db])) @@ -211,7 +210,6 @@ :universal-links/url :browser/browsers :browser/options - :new/open-dapp :navigation/screen-params :chat/cooldowns :chat/cooldown-enabled? diff --git a/src/status_im/ui/screens/events.cljs b/src/status_im/ui/screens/events.cljs index ed66da07e019..f6690aa90302 100644 --- a/src/status_im/ui/screens/events.cljs +++ b/src/status_im/ui/screens/events.cljs @@ -1,6 +1,5 @@ (ns status-im.ui.screens.events (:require status-im.events - status-im.ui.screens.add-new.events status-im.ui.screens.add-new.new-chat.events status-im.ui.screens.group.chat-settings.events status-im.ui.screens.group.events diff --git a/src/status_im/ui/screens/home/sheet/views.cljs b/src/status_im/ui/screens/home/sheet/views.cljs index 4ed0a36f3618..5878f8570044 100644 --- a/src/status_im/ui/screens/home/sheet/views.cljs +++ b/src/status_im/ui/screens/home/sheet/views.cljs @@ -1,5 +1,5 @@ (ns status-im.ui.screens.home.sheet.views - (:require-macros [status-im.utils.views :refer [defview letsubs] :as views]) + (:require-macros [status-im.utils.views :refer [defview letsubs]]) (:require [re-frame.core :as re-frame] [status-im.i18n :as i18n] [status-im.ui.components.colors :as colors] @@ -34,14 +34,6 @@ :accessibility-label :join-public-chat-button :icon :main-icons/public-chat :on-press #(hide-sheet-and-dispatch [:navigate-to :new-public-chat])}] - [list-item/list-item - {:theme :action - :title :t/scan-qr - :accessibility-label :scan-qr-code-button - :icon :main-icons/qr - :on-press #(hide-sheet-and-dispatch [:qr-scanner.ui/scan-qr-code-pressed - {:title (i18n/label :t/scan-qr) - :handler :handle-qr-code}])}] [list-item/list-item {:theme :action :title :t/invite-friends @@ -110,7 +102,7 @@ (def add-new {:content add-new-view - :content-height 320}) + :content-height 280}) (def public-chat-actions {:content public-chat-actions-view diff --git a/src/status_im/ui/screens/routing/chat_stack.cljs b/src/status_im/ui/screens/routing/chat_stack.cljs index fbedbdd4e173..c5c3edf3f55e 100644 --- a/src/status_im/ui/screens/routing/chat_stack.cljs +++ b/src/status_im/ui/screens/routing/chat_stack.cljs @@ -6,7 +6,6 @@ :chat :select-chat :profile - :new :take-picture :new-group :add-participants-toggle-list diff --git a/src/status_im/ui/screens/routing/screens.cljs b/src/status_im/ui/screens/routing/screens.cljs index ee6455a00803..b454fad2fe4d 100644 --- a/src/status_im/ui/screens/routing/screens.cljs +++ b/src/status_im/ui/screens/routing/screens.cljs @@ -4,7 +4,6 @@ [status-im.ui.screens.multiaccounts.views :as multiaccounts] [status-im.ui.screens.add-new.new-chat.views :as new-chat] [status-im.ui.screens.add-new.new-public-chat.view :as new-public-chat] - [status-im.ui.screens.add-new.views :as add-new] [status-im.ui.screens.bootnodes-settings.edit-bootnode.views :as edit-bootnode] @@ -119,7 +118,6 @@ :chat chat/chat :select-chat chat/select-chat :profile profile.contact/profile - :new add-new/add-new :new-chat [:modal new-chat/new-chat] :qr-scanner [:modal qr-scanner/qr-scanner] :new-group group/new-group diff --git a/test/cljs/status_im/test/runner.cljs b/test/cljs/status_im/test/runner.cljs index 7da973977b63..e6331520bfd7 100644 --- a/test/cljs/status_im/test/runner.cljs +++ b/test/cljs/status_im/test/runner.cljs @@ -39,7 +39,6 @@ [status-im.test.tribute-to-talk.core] [status-im.test.tribute-to-talk.db] [status-im.test.tribute-to-talk.whitelist] - [status-im.test.ui.screens.add-new.models] [status-im.test.ui.screens.currency-settings.models] [status-im.test.ui.screens.wallet.db] [status-im.test.utils.async] @@ -114,7 +113,6 @@ 'status-im.test.tribute-to-talk.core 'status-im.test.tribute-to-talk.db 'status-im.test.tribute-to-talk.whitelist - 'status-im.test.ui.screens.add-new.models 'status-im.test.ui.screens.currency-settings.models 'status-im.test.ui.screens.wallet.db 'status-im.test.utils.async diff --git a/test/cljs/status_im/test/ui/screens/add-new/models.cljs b/test/cljs/status_im/test/ui/screens/add-new/models.cljs deleted file mode 100644 index 5fa240d8ebbb..000000000000 --- a/test/cljs/status_im/test/ui/screens/add-new/models.cljs +++ /dev/null @@ -1,18 +0,0 @@ -(ns status-im.test.ui.screens.add-new.models - (:require [cljs.test :refer-macros [deftest is testing]] - [status-im.ui.screens.add-new.models :as models])) - -(def cofx {:db {:multiaccount {:public-key "0x04e1433c1a8ad71280e6d4b1814aa3958ba6eb451da47ea1d4a4bfc4a04969c445548f3bd9d40fa7e4356aa62075b4d7615179ef1332f1d6a7c59b96c4ab8e04c1"}}}) - -(deftest test-handle-qr-code - (testing "handle contact code" - (is (= :profile - (get-in (models/handle-qr-code cofx "0x04405dfcf94380f9159a1bf8d7dbfce19dd2a3552695bf5e6dd96fb8c3c016c62adaf036b387e7f68621c366186f59dae2561374752996aa13ffc57aad9e6e7202") [:db :view-id])))) - (testing "handle own contact code" - (is (= :my-profile - (get-in (models/handle-qr-code cofx "0x04e1433c1a8ad71280e6d4b1814aa3958ba6eb451da47ea1d4a4bfc4a04969c445548f3bd9d40fa7e4356aa62075b4d7615179ef1332f1d6a7c59b96c4ab8e04c1") [:db :view-id])))) - (testing "handle universal link" - (is (= (:browser/show-browser-selection (models/handle-qr-code cofx "status-im://browse/www.cryptokitties.co")) - "www.cryptokitties.co"))) - (testing "handle invalid qr code" - (is (:utils/show-popup (models/handle-qr-code cofx "a random string"))))) diff --git a/translations/en.json b/translations/en.json index a17a1968d653..168b52b1b48a 100644 --- a/translations/en.json +++ b/translations/en.json @@ -508,7 +508,7 @@ "help": "help", "help-capitalized": "Help", "help-center": "Help Center", - "hide-content-when-switching-apps": "Hide content when switching apps", + "hide-content-when-switching-apps": "White out Status when switching apps", "history": "History", "hold-card": "Hold card to the back\n of your phone", "home": "Home",