[#8624] Disable stickers in testnet

Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
Andrey Shovkoplyas 2019-07-24 13:25:25 +02:00
parent 06dd2e5293
commit 50d64fee65
No known key found for this signature in database
GPG Key ID: EAAB7C8622D860A4
2 changed files with 6 additions and 4 deletions

View File

@ -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)]

View File

@ -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]