mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-24 04:28:58 +00:00
fix(@desktop/onboarding): keycard is not shown in settings after first launch
Fixes: #11314
This commit is contained in:
parent
7849d03707
commit
f55123ddf1
@ -18,7 +18,7 @@ proc buildKeypairAndAddToMigratedKeypairs(self: CopyingKeycardState, controller:
|
|||||||
keycardLocked: false,
|
keycardLocked: false,
|
||||||
keyUid: controller.getKeyPairForProcessing().getKeyUid(),
|
keyUid: controller.getKeyPairForProcessing().getKeyUid(),
|
||||||
accountsAddresses: addresses)
|
accountsAddresses: addresses)
|
||||||
controller.addKeycardOrAccounts(keycardDto)
|
controller.addKeycardOrAccounts(keycardDto, accountsComingFromKeycard = true)
|
||||||
|
|
||||||
proc runStoreMetadataFlow(self: CopyingKeycardState, controller: Controller) =
|
proc runStoreMetadataFlow(self: CopyingKeycardState, controller: Controller) =
|
||||||
let cardMetadata = controller.getMetadataForKeycardCopy()
|
let cardMetadata = controller.getMetadataForKeycardCopy()
|
||||||
@ -32,7 +32,7 @@ method executePrePrimaryStateCommand*(self: CopyingKeycardState, controller: Con
|
|||||||
self.buildKeypairAndAddToMigratedKeypairs(controller)
|
self.buildKeypairAndAddToMigratedKeypairs(controller)
|
||||||
|
|
||||||
method executePreSecondaryStateCommand*(self: CopyingKeycardState, controller: Controller) =
|
method executePreSecondaryStateCommand*(self: CopyingKeycardState, controller: Controller) =
|
||||||
## Secondary action is called after each async action during migration process.
|
## Secondary action is called after each async action during migration process.
|
||||||
if self.flowType == FlowType.CreateCopyOfAKeycard:
|
if self.flowType == FlowType.CreateCopyOfAKeycard:
|
||||||
if controller.getAddingMigratedKeypairSuccess():
|
if controller.getAddingMigratedKeypairSuccess():
|
||||||
self.runStoreMetadataFlow(controller)
|
self.runStoreMetadataFlow(controller)
|
||||||
@ -42,12 +42,12 @@ method getNextSecondaryState*(self: CopyingKeycardState, controller: Controller)
|
|||||||
if not controller.getAddingMigratedKeypairSuccess():
|
if not controller.getAddingMigratedKeypairSuccess():
|
||||||
return createState(StateType.CopyingKeycardFailure, self.flowType, nil)
|
return createState(StateType.CopyingKeycardFailure, self.flowType, nil)
|
||||||
|
|
||||||
method resolveKeycardNextState*(self: CopyingKeycardState, keycardFlowType: string, keycardEvent: KeycardEvent,
|
method resolveKeycardNextState*(self: CopyingKeycardState, keycardFlowType: string, keycardEvent: KeycardEvent,
|
||||||
controller: Controller): State =
|
controller: Controller): State =
|
||||||
let state = ensureReaderAndCardPresenceAndResolveNextState(self, keycardFlowType, keycardEvent, controller)
|
let state = ensureReaderAndCardPresenceAndResolveNextState(self, keycardFlowType, keycardEvent, controller)
|
||||||
if not state.isNil:
|
if not state.isNil:
|
||||||
return state
|
return state
|
||||||
if self.flowType == FlowType.CreateCopyOfAKeycard:
|
if self.flowType == FlowType.CreateCopyOfAKeycard:
|
||||||
if keycardFlowType == ResponseTypeValueKeycardFlowResult and
|
if keycardFlowType == ResponseTypeValueKeycardFlowResult and
|
||||||
keycardEvent.error.len == 0:
|
keycardEvent.error.len == 0:
|
||||||
return createState(StateType.CopyingKeycardSuccess, self.flowType, nil)
|
return createState(StateType.CopyingKeycardSuccess, self.flowType, nil)
|
@ -74,7 +74,8 @@ const FlowsWeShouldNotTryAKeycardSyncFor* = @[
|
|||||||
FlowType.SetupNewKeycardNewSeedPhrase,
|
FlowType.SetupNewKeycardNewSeedPhrase,
|
||||||
FlowType.SetupNewKeycardOldSeedPhrase,
|
FlowType.SetupNewKeycardOldSeedPhrase,
|
||||||
FlowType.ImportFromKeycard,
|
FlowType.ImportFromKeycard,
|
||||||
FlowType.Authentication
|
FlowType.Authentication,
|
||||||
|
FlowType.CreateCopyOfAKeycard
|
||||||
]
|
]
|
||||||
|
|
||||||
type
|
type
|
||||||
|
@ -269,7 +269,7 @@ proc handleKeycardSyncing[T](self: Module[T]) =
|
|||||||
if accountsToRemove.len > 0:
|
if accountsToRemove.len > 0:
|
||||||
self.controller.removeMigratedAccountsForKeycard(kpDto.keyUid, kpDto.keycardUid, accountsToRemove)
|
self.controller.removeMigratedAccountsForKeycard(kpDto.keyUid, kpDto.keycardUid, accountsToRemove)
|
||||||
if kpDto.accountsAddresses.len > 0:
|
if kpDto.accountsAddresses.len > 0:
|
||||||
self.controller.addKeycardOrAccounts(kpDto)
|
self.controller.addKeycardOrAccounts(kpDto, accountsComingFromKeycard = true)
|
||||||
# if all accounts are removed from the app, there is no point in storing empty accounts list to a keycard, cause in that case
|
# if all accounts are removed from the app, there is no point in storing empty accounts list to a keycard, cause in that case
|
||||||
# keypair which is on that keycard won't be known to the app, that means keypair was removed from the app
|
# keypair which is on that keycard won't be known to the app, that means keypair was removed from the app
|
||||||
if activeValidPathsToStoreToAKeycard.len > 0:
|
if activeValidPathsToStoreToAKeycard.len > 0:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user