mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-20 02:28:56 +00:00
fix(@desktop/wallet): issues migrating a keypair if the profile keypair is already migrated to a keycard fixed
Closes: #10527
This commit is contained in:
parent
a73ea4604e
commit
dbef72be01
@ -34,7 +34,10 @@ proc runStoreMetadataFlow(self: MigratingKeyPairState, controller: Controller) =
|
|||||||
|
|
||||||
method executePrePrimaryStateCommand*(self: MigratingKeyPairState, controller: Controller) =
|
method executePrePrimaryStateCommand*(self: MigratingKeyPairState, controller: Controller) =
|
||||||
if self.flowType == FlowType.SetupNewKeycard:
|
if self.flowType == FlowType.SetupNewKeycard:
|
||||||
|
if controller.getSelectedKeyPairIsProfile():
|
||||||
controller.authenticateUser()
|
controller.authenticateUser()
|
||||||
|
return
|
||||||
|
self.doMigration(controller)
|
||||||
|
|
||||||
method executePreSecondaryStateCommand*(self: MigratingKeyPairState, controller: Controller) =
|
method executePreSecondaryStateCommand*(self: MigratingKeyPairState, controller: Controller) =
|
||||||
## Secondary action is called after each async action during migration process.
|
## Secondary action is called after each async action during migration process.
|
||||||
@ -59,13 +62,6 @@ method executePreSecondaryStateCommand*(self: MigratingKeyPairState, controller:
|
|||||||
if self.profileConversionOk:
|
if self.profileConversionOk:
|
||||||
self.runStoreMetadataFlow(controller)
|
self.runStoreMetadataFlow(controller)
|
||||||
else:
|
else:
|
||||||
if not self.authenticationDone:
|
|
||||||
self.authenticationDone = true
|
|
||||||
let password = controller.getPassword()
|
|
||||||
self.authenticationOk = controller.verifyPassword(password)
|
|
||||||
if self.authenticationOk:
|
|
||||||
self.doMigration(controller)
|
|
||||||
return
|
|
||||||
if not self.addingMigratedKeypairDone:
|
if not self.addingMigratedKeypairDone:
|
||||||
self.addingMigratedKeypairDone = true
|
self.addingMigratedKeypairDone = true
|
||||||
self.addingMigratedKeypairOk = controller.getAddingMigratedKeypairSuccess()
|
self.addingMigratedKeypairOk = controller.getAddingMigratedKeypairSuccess()
|
||||||
@ -74,7 +70,7 @@ method executePreSecondaryStateCommand*(self: MigratingKeyPairState, controller:
|
|||||||
|
|
||||||
method getNextSecondaryState*(self: MigratingKeyPairState, controller: Controller): State =
|
method getNextSecondaryState*(self: MigratingKeyPairState, controller: Controller): State =
|
||||||
if self.flowType == FlowType.SetupNewKeycard:
|
if self.flowType == FlowType.SetupNewKeycard:
|
||||||
if self.authenticationDone and not self.authenticationOk or
|
if controller.getSelectedKeyPairIsProfile() and self.authenticationDone and not self.authenticationOk or
|
||||||
self.addingMigratedKeypairDone and not self.addingMigratedKeypairOk or
|
self.addingMigratedKeypairDone and not self.addingMigratedKeypairOk or
|
||||||
self.profileConversionDone and not self.profileConversionOk:
|
self.profileConversionDone and not self.profileConversionOk:
|
||||||
return createState(StateType.KeyPairMigrateFailure, self.flowType, nil)
|
return createState(StateType.KeyPairMigrateFailure, self.flowType, nil)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user