[#7598] Beta alert on upgrading

Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
This commit is contained in:
Emilio Silva Schlenker 2019-04-11 13:28:09 -05:00 committed by Igor Mandrigin
parent 55abf20645
commit 64b63d5593
No known key found for this signature in database
GPG Key ID: 4A0EDDE26E66BC8B
5 changed files with 22 additions and 7 deletions

View File

@ -8,7 +8,8 @@
[status-im.utils.config :as config]
[status-im.utils.utils :as utils]
[status-im.utils.fx :as fx]
[status-im.utils.platform :as platform]))
[status-im.utils.platform :as platform]
[status-im.utils.build :as build]))
(re-frame/reg-fx
::chaos-mode-changed
@ -16,10 +17,11 @@
(native-module/chaos-mode-update on (constantly nil))))
(fx/defn show-mainnet-is-default-alert [{:keys [db]}]
(let [shown? (get-in db [:account/account :mainnet-warning-shown?])]
(let [shown-version (get-in db [:account/account :mainnet-warning-shown-version])
current-version build/version]
(when (and platform/mobile?
config/mainnet-warning-enabled?
(not shown?))
(not= shown-version current-version))
(utils/show-popup
(i18n/label :mainnet-is-default-alert-title)
(i18n/label :mainnet-is-default-alert-text)

View File

@ -55,7 +55,7 @@
(spec/def :account/seed-backed-up? (spec/nilable boolean?))
(spec/def :account/installation-id :global/not-empty-string)
(spec/def :account/wallet-set-up-passed? (spec/nilable boolean?))
(spec/def :account/mainnet-warning-shown? (spec/nilable boolean?))
(spec/def :account/mainnet-warning-shown-version (spec/nilable string?))
(spec/def :account/desktop-alpha-release-warning-shown? (spec/nilable boolean?))
(spec/def :account/keycard-instance-uid (spec/nilable string?))
(spec/def :account/keycard-pairing (spec/nilable string?))
@ -71,7 +71,7 @@
:account/seed-backed-up? :account/mnemonic :account/desktop-notifications?
:account/wallet-set-up-passed? :account/last-request
:account/bootnodes :account/extensions
:account/mainnet-warning-shown?
:account/mainnet-warning-shown-version
:account/desktop-alpha-release-warning-shown?
:account/keycard-instance-uid
:account/keycard-pairing

View File

@ -238,3 +238,7 @@
(def v21 (update v20 :properties merge
{:syncing-on-mobile-network? {:type :bool :default false}
:remember-syncing-choice? {:type :bool :default false}}))
(def v22 (update (update v21 :properties dissoc :mainnet-warning-shown?)
:properties merge
{:mainnet-warning-shown-version {:type :string :optional true}}))

View File

@ -103,6 +103,11 @@
extension/v12
account/v21])
(def v27 [network/v1
bootnode/v4
extension/v12
account/v22])
;; put schemas ordered by version
(def schemas [{:schema v1
:schemaVersion 1
@ -181,4 +186,7 @@
:migration (constantly nil)}
{:schema v26
:schemaVersion 26
:migration (constantly nil)}
{:schema v27
:schemaVersion 27
:migration (constantly nil)}])

View File

@ -53,7 +53,8 @@
[status-im.stickers.core :as stickers]
[status-im.utils.config :as config]
[status-im.ui.components.bottom-sheet.core :as bottom-sheet]
[status-im.ui.components.react :as react]))
[status-im.ui.components.react :as react]
[status-im.utils.build :as build]))
;; init module
@ -155,7 +156,7 @@
(handlers/register-handler-fx
:accounts.ui/mainnet-warning-shown
(fn [cofx _]
(accounts.update/account-update cofx {:mainnet-warning-shown? true} {})))
(accounts.update/account-update cofx {:mainnet-warning-shown-version build/version} {})))
(handlers/register-handler-fx
:accounts.update.callback/published