fix notification screen displayed twice

Signed-off-by: Michele Balistreri <michele@bitgamma.com>
This commit is contained in:
Michele Balistreri 2021-07-20 15:02:03 +02:00
parent 40b1a9b8ae
commit ebf951d110
No known key found for this signature in database
GPG Key ID: E9567DA33A4F791A
4 changed files with 10 additions and 10 deletions

View File

@ -175,8 +175,7 @@
(fx/merge cofx (fx/merge cofx
{:db (-> db {:db (-> db
(assoc-in [:keycard :setup-step] nil) (assoc-in [:keycard :setup-step] nil)
(dissoc :intro-wizard)) (dissoc :intro-wizard))}
:init-root-fx :onboarding-notification}
(multiaccounts.create/on-multiaccount-created (multiaccounts.create/on-multiaccount-created
{:recovered (or recovered (get-in db [:intro-wizard :recovering?])) {:recovered (or recovered (get-in db [:intro-wizard :recovering?]))
:derived {constants/path-wallet-root-keyword :derived {constants/path-wallet-root-keyword

View File

@ -143,7 +143,8 @@
{:events [::delete-multiaccount-and-init-keycard-onboarding]} {:events [::delete-multiaccount-and-init-keycard-onboarding]}
[{:keys [db] :as cofx}] [{:keys [db] :as cofx}]
(let [{:keys [key-uid]} (-> db :multiaccounts/login)] (let [{:keys [key-uid]} (-> db :multiaccounts/login)]
{::delete-multiaccount {:key-uid key-uid {:db (assoc-in db [:multiaccounts/key-storage :reset-db-checked?] true)
::delete-multiaccount {:key-uid key-uid
:on-error #(re-frame/dispatch [::delete-multiaccount-error %]) :on-error #(re-frame/dispatch [::delete-multiaccount-error %])
:on-success #(re-frame/dispatch [::delete-multiaccount-success])}})) :on-success #(re-frame/dispatch [::delete-multiaccount-success])}}))

View File

@ -337,15 +337,12 @@
(fx/defn login-only-events (fx/defn login-only-events
[{:keys [db] :as cofx} key-uid password save-password?] [{:keys [db] :as cofx} key-uid password save-password?]
(let [auth-method (:auth-method db) (let [auth-method (:auth-method db)
new-auth-method (get-new-auth-method auth-method save-password?) new-auth-method (get-new-auth-method auth-method save-password?)]
from-migration? (get-in db [:keycard :from-key-storage-and-migration?])]
(log/debug "[login] login-only-events" (log/debug "[login] login-only-events"
"auth-method" auth-method "auth-method" auth-method
"new-auth-method" new-auth-method) "new-auth-method" new-auth-method)
(fx/merge cofx (fx/merge cofx
{:db (-> db {:db (assoc db :chats/loading? true)
(assoc :chats/loading? true)
(update :keycard dissoc :from-key-storage-and-migration?))
::json-rpc/call ::json-rpc/call
[{:method "browsers_getBrowsers" [{:method "browsers_getBrowsers"
:on-success #(re-frame/dispatch [::initialize-browsers %])} :on-success #(re-frame/dispatch [::initialize-browsers %])}
@ -357,8 +354,6 @@
:on-success #(do (re-frame/dispatch [::get-settings-callback %]) :on-success #(do (re-frame/dispatch [::get-settings-callback %])
(redirect-to-root db))}]} (redirect-to-root db))}]}
(notifications/load-notification-preferences) (notifications/load-notification-preferences)
(when from-migration?
(utils/show-popup (i18n/label :t/migration-successful) (i18n/label :t/migration-successful-text)))
(when save-password? (when save-password?
(keychain/save-user-password key-uid password)) (keychain/save-user-password key-uid password))
(keychain/save-auth-method key-uid (or new-auth-method auth-method keychain/auth-method-none))))) (keychain/save-auth-method key-uid (or new-auth-method auth-method keychain/auth-method-none)))))
@ -408,6 +403,7 @@
login-only? (not (or creating? login-only? (not (or creating?
recovered-account? recovered-account?
(keycard-setup? cofx))) (keycard-setup? cofx)))
from-migration? (get-in db [:keycard :from-key-storage-and-migration?])
nodes nil nodes nil
should-send-metrics? (get-in db [:multiaccount :anon-metrics/should-send?])] should-send-metrics? (get-in db [:multiaccount :anon-metrics/should-send?])]
(log/debug "[multiaccount] multiaccount-login-success" (log/debug "[multiaccount] multiaccount-login-success"
@ -416,6 +412,7 @@
(fx/merge cofx (fx/merge cofx
{:db (-> db {:db (-> db
(dissoc :connectivity/ui-status-properties) (dissoc :connectivity/ui-status-properties)
(update :keycard dissoc :from-key-storage-and-migration?)
(update :keycard dissoc (update :keycard dissoc
:on-card-read :on-card-read
:card-read-in-progress? :card-read-in-progress?
@ -439,6 +436,8 @@
(when (and (not login-only?) (when (and (not login-only?)
(not recovered-account?)) (not recovered-account?))
(wallet/set-initial-blocks-range)) (wallet/set-initial-blocks-range))
(when from-migration?
(utils/show-popup (i18n/label :t/migration-successful) (i18n/label :t/migration-successful-text)))
(if login-only? (if login-only?
(login-only-events key-uid password save-password?) (login-only-events key-uid password save-password?)
(create-only-events))))) (create-only-events)))))

View File

@ -78,6 +78,7 @@
:subtitle (i18n/label :t/reset-database-warning) :subtitle (i18n/label :t/reset-database-warning)
:subtitle-max-lines 4 :subtitle-max-lines 4
:active reset-db-checked? :active reset-db-checked?
:disabled (not move-keystore-checked?)
:on-press #(re-frame/dispatch [::multiaccounts.key-storage/reset-db-checked (not reset-db-checked?)]) :on-press #(re-frame/dispatch [::multiaccounts.key-storage/reset-db-checked (not reset-db-checked?)])
:accessory :checkbox}]] :accessory :checkbox}]]
(when (and next-title next-event) (when (and next-title next-event)