From 8dd04570e446d6e64c321914e0bc991a12a18ab9 Mon Sep 17 00:00:00 2001 From: janherich Date: Mon, 30 Apr 2018 08:17:31 +0200 Subject: [PATCH] Hide group chats behind flag Signed-off-by: Andrea Maria Piana --- .env | 1 + .env.e2e | 1 + .env.jenkins | 1 + .env.prod | 1 + src/status_im/ui/screens/add_new/views.cljs | 16 +++++++++------- src/status_im/utils/config.cljs | 2 ++ 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.env b/.env index 65ac66f3ce..3b175ed50d 100644 --- a/.env +++ b/.env @@ -19,3 +19,4 @@ TESTFAIRY_TOKEN=969f6c921cb435cea1d41d1ea3f5b247d6026d55 INSTABUG_TOKEN=758630ed52864cbad9c5eeeac596c60c DEBUG_WEBVIEW=1 INSTABUG_SURVEYS=1 +GROUP_CHATS_ENABLED=1 diff --git a/.env.e2e b/.env.e2e index 7e6693cc83..74c027b8ac 100644 --- a/.env.e2e +++ b/.env.e2e @@ -18,3 +18,4 @@ DEFAULT_NETWORK=testnet_rpc INSTABUG_TOKEN=758630ed52864cbad9c5eeeac596c60c DEBUG_WEBVIEW=1 INSTABUG_SURVEYS=0 +GROUP_CHATS_ENABLED=1 diff --git a/.env.jenkins b/.env.jenkins index 2ff9f86949..7d4b81cf15 100644 --- a/.env.jenkins +++ b/.env.jenkins @@ -19,3 +19,4 @@ DEFAULT_NETWORK=mainnet_rpc INSTABUG_TOKEN=758630ed52864cbad9c5eeeac596c60c DEBUG_WEBVIEW=1 INSTABUG_SURVEYS=1 +GROUP_CHATS_ENABLED=1 diff --git a/.env.prod b/.env.prod index 46cef62ad6..6153df654c 100644 --- a/.env.prod +++ b/.env.prod @@ -19,3 +19,4 @@ DEFAULT_NETWORK=testnet_rpc INSTABUG_TOKEN=758630ed52864cbad9c5eeeac596c60c DEBUG_WEBVIEW=0 INSTABUG_SURVEYS=1 +GROUP_CHATS_ENABLED=0 diff --git a/src/status_im/ui/screens/add_new/views.cljs b/src/status_im/ui/screens/add_new/views.cljs index 69434c937d..d5a0c2fd84 100644 --- a/src/status_im/ui/screens/add_new/views.cljs +++ b/src/status_im/ui/screens/add_new/views.cljs @@ -2,6 +2,7 @@ (:require-macros [status-im.utils.views :as views]) (:require [re-frame.core :as re-frame] [status-im.i18n :as i18n] + [status-im.utils.config :as config] [status-im.ui.components.action-button.action-button :as action-button] [status-im.ui.components.action-button.styles :as action-button.styles] [status-im.ui.components.colors :as colors] @@ -21,13 +22,14 @@ :icon-opts {:color colors/blue} :on-press #(re-frame/dispatch [:navigate-to :new-chat])}] [action-button/action-separator] - ;; TODO temporary removal before everything is fixed in group chats - [action-button/action-button - {:label (i18n/label :t/start-group-chat) - :accessibility-label :start-group-chat-button - :icon :icons/contacts - :icon-opts {:color colors/blue} - :on-press #(re-frame/dispatch [:open-contact-toggle-list :chat-group])}] + ;; Hide behind flag (false by default), till everything is fixed in group chats + (when config/group-chats-enabled? + [action-button/action-button + {:label (i18n/label :t/start-group-chat) + :accessibility-label :start-group-chat-button + :icon :icons/contacts + :icon-opts {:color colors/blue} + :on-press #(re-frame/dispatch [:open-contact-toggle-list :chat-group])}]) [action-button/action-separator] [action-button/action-button {:label (i18n/label :t/new-public-group-chat) diff --git a/src/status_im/utils/config.cljs b/src/status_im/utils/config.cljs index 54c32b1604..c9dc314022 100644 --- a/src/status_im/utils/config.cljs +++ b/src/status_im/utils/config.cljs @@ -41,3 +41,5 @@ (def pow-target (js/parseFloat (get-config :POW_TARGET "0.002"))) (def pow-time (js/parseInt (get-config :POW_TIME "1"))) + +(def group-chats-enabled? (enabled? (get-config :GROUP_CHATS_ENABLED)))