Skip to content

Commit

Permalink
fix(@desktop/keycard): cleaning last received data from the keycard s…
Browse files Browse the repository at this point in the history
…ervice after ui flow is done
  • Loading branch information
saledjenic committed Apr 27, 2023
1 parent 6ca9da5 commit 0a04e1a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app/modules/shared_modules/keycard_popup/controller.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/app/modules/shared_modules/keycard_popup/module.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
3 changes: 3 additions & 0 deletions src/app_service/service/keycard/service.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0a04e1a

Please sign in to comment.