From 50d64fee65d981c9d2ba552652c842100bbfd38b Mon Sep 17 00:00:00 2001 From: Andrey Shovkoplyas Date: Wed, 24 Jul 2019 13:25:25 +0200 Subject: [PATCH] [#8624] Disable stickers in testnet Signed-off-by: Andrey Shovkoplyas --- src/status_im/stickers/core.cljs | 7 ++++--- src/status_im/ui/screens/chat/input/input.cljs | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/status_im/stickers/core.cljs b/src/status_im/stickers/core.cljs index fbe94d0f34..379f6ca369 100644 --- a/src/status_im/stickers/core.cljs +++ b/src/status_im/stickers/core.cljs @@ -11,7 +11,8 @@ [status-im.utils.utils :as utils] [status-im.signing.core :as signing] [status-im.utils.contenthash :as contenthash] - [status-im.multiaccounts.update.core :as multiaccounts.update])) + [status-im.multiaccounts.update.core :as multiaccounts.update] + [clojure.string :as string])) (defn pack-data-callback [id open?] @@ -119,8 +120,8 @@ (navigation/navigate-to-cofx % :stickers-pack-modal pack))))) (fx/defn open-sticker-pack - [{{:stickers/keys [packs packs-installed] :as db} :db :as cofx} id] - (when id + [{{:stickers/keys [packs packs-installed] :keys [network] :as db} :db :as cofx} id] + (when (and id (string/starts-with? network "mainnet")) (let [pack (or (get packs-installed id) (get packs id)) contract-address (contracts/get-address db :status/stickers)] diff --git a/src/status_im/ui/screens/chat/input/input.cljs b/src/status_im/ui/screens/chat/input/input.cljs index 19cb052882..91766b326a 100644 --- a/src/status_im/ui/screens/chat/input/input.cljs +++ b/src/status_im/ui/screens/chat/input/input.cljs @@ -178,6 +178,7 @@ (defview input-container [] (letsubs [margin [:chats/input-margin] + network [:get-network] {:keys [input-text]} [:chats/current-chat] result-box [:chats/current-chat-ui-prop :result-box] show-stickers? [:chats/current-chat-ui-prop :show-stickers?] @@ -201,7 +202,7 @@ [reply-message-view] [react/view {:style style/input-container} [input-view {:single-line-input? single-line-input? :set-text set-text :state-text state-text}] - (when input-text-empty? + (when (and input-text-empty? (string/starts-with? network "mainnet")) [stickers/button show-stickers?]) (if input-text-empty? [commands-button]