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
{:db (-> db
(assoc-in [:keycard :setup-step] nil)
(dissoc :intro-wizard))
:init-root-fx :onboarding-notification}
(dissoc :intro-wizard))}
(multiaccounts.create/on-multiaccount-created
{:recovered (or recovered (get-in db [:intro-wizard :recovering?]))
:derived {constants/path-wallet-root-keyword

View File

@ -143,7 +143,8 @@
{:events [::delete-multiaccount-and-init-keycard-onboarding]}
[{:keys [db] :as cofx}]
(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-success #(re-frame/dispatch [::delete-multiaccount-success])}}))

View File

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

View File

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