diff --git a/.env.e2e b/.env.e2e index f47607e159..ed270643dc 100644 --- a/.env.e2e +++ b/.env.e2e @@ -35,3 +35,5 @@ LOCAL_PAIRING_ENABLED=1 FAST_CREATE_COMMUNITY_ENABLED=1 TEST_NETWORKS_ENABLED=1 SHOW_NOT_IMPLEMENTED_FEATURES=1 +DELETE_MESSAGE_FOR_ME_UNDO_TIME_LIMIT=10000 +DELETE_MESSAGE_UNDO_TIME_LIMIT=10000 diff --git a/src/status_im/config.cljs b/src/status_im/config.cljs index c18dfbe8e2..841cfb321c 100644 --- a/src/status_im/config.cljs +++ b/src/status_im/config.cljs @@ -2,6 +2,7 @@ (:require [clojure.string :as string] [react-native.config :as react-native-config] + [status-im.constants :as constants] [utils.ens.core :as utils.ens] [utils.ethereum.chain :as chain])) @@ -70,6 +71,18 @@ ; currently not supported in status-go (def enable-remove-profile-picture? false) +(defn env-variable->int + [env-var-name default-value] + (js/parseInt (get-config env-var-name default-value))) + +(def delete-message-for-me-undo-time-limit-ms + (env-variable->int :DELETE_MESSAGE_FOR_ME_UNDO_TIME_LIMIT + constants/delete-message-for-me-undo-time-limit-ms)) + +(def delete-message-undo-time-limit-ms + (env-variable->int :DELETE_MESSAGE_UNDO_TIME_LIMIT + constants/delete-message-undo-time-limit-ms)) + (def verify-transaction-chain-id (js/parseInt (get-config :VERIFY_TRANSACTION_CHAIN_ID "1"))) (def verify-transaction-url (if (= :mainnet (chain/chain-id->chain-keyword verify-transaction-chain-id)) diff --git a/src/status_im/contexts/chat/messenger/messages/drawers/view.cljs b/src/status_im/contexts/chat/messenger/messages/drawers/view.cljs index 037a442eba..c0aa534435 100644 --- a/src/status_im/contexts/chat/messenger/messages/drawers/view.cljs +++ b/src/status_im/contexts/chat/messenger/messages/drawers/view.cljs @@ -7,6 +7,7 @@ [react-native.gesture :as gesture] [reagent.core :as reagent] [status-im.common.contact-list-item.view :as contact-list-item] + [status-im.config :as config] [status-im.constants :as constants] [status-im.contexts.chat.messenger.composer.reply.view :as reply] [status-im.contexts.chat.messenger.messages.drawers.style :as style] @@ -140,7 +141,7 @@ (rf/dispatch [:hide-bottom-sheet]) (rf/dispatch [:chat.ui/delete-message-for-me message-data - constants/delete-message-for-me-undo-time-limit-ms])) + config/delete-message-for-me-undo-time-limit-ms])) :label (i18n/label :t/delete-for-me) :icon :i/delete @@ -155,7 +156,7 @@ :on-press (fn [] (rf/dispatch [:hide-bottom-sheet]) (rf/dispatch [:chat.ui/delete-message message-data - constants/delete-message-undo-time-limit-ms])) + config/delete-message-undo-time-limit-ms])) :label (i18n/label :t/delete-for-everyone) :icon :i/delete :id :delete-for-all}])))