fix(@desktop/keycard): cleaning last received data from the keycard service after ui flow is done

This commit is contained in:
Sale Djenic 2023-04-25 08:51:29 +02:00 committed by saledjenic
parent 6ca9da5e84
commit 0a04e1a67c
3 changed files with 9 additions and 0 deletions

View File

@ -406,6 +406,11 @@ proc getLastReceivedKeycardData*(self: Controller): tuple[flowType: string, flow
return
return self.keycardService.getLastReceivedKeycardData()
proc cleanReceivedKeycardData*(self: Controller) =
if not serviceApplicable(self.keycardService):
return
self.keycardService.cleanReceivedKeycardData()
proc getMetadataFromKeycard*(self: Controller): CardMetadata =
return self.tmpCardMetadata

View File

@ -61,6 +61,7 @@ method delete*[T](self: Module[T]) =
proc init[T](self: Module[T], fullConnect = true) =
if not self.initialized:
self.initialized = true
self.controller.cleanReceivedKeycardData()
self.controller.init(fullConnect)
method getModuleAsVariant*[T](self: Module[T]): QVariant =

View File

@ -112,6 +112,9 @@ QtObject:
proc getLastReceivedKeycardData*(self: Service): tuple[flowType: string, flowEvent: KeycardEvent] =
return self.lastReceivedKeycardData
proc cleanReceivedKeycardData*(self: Service) =
self.lastReceivedKeycardData = ("", KeycardEvent())
proc buildSeedPhrasesFromIndexes*(self: Service, seedPhraseIndexes: seq[int]): seq[string] =
var seedPhrase: seq[string]
for ind in seedPhraseIndexes: