diff --git a/src/app/modules/startup/controller.nim b/src/app/modules/startup/controller.nim index 5de3432530..435706c936 100644 --- a/src/app/modules/startup/controller.nim +++ b/src/app/modules/startup/controller.nim @@ -48,6 +48,7 @@ method init*(self: Controller) = self.events.on(SignalType.NodeStopped.event) do(e:Args): echo "-NEW-EVENT-- NodeStopped: ", repr(e) self.events.emit("nodeStopped", Args()) + self.accountsService.clear() self.delegate.emitLogOut() self.events.on(SignalType.NodeReady.event) do(e:Args): diff --git a/src/app_service/service/accounts/service.nim b/src/app_service/service/accounts/service.nim index 2221cb19fb..f66e55964a 100644 --- a/src/app_service/service/accounts/service.nim +++ b/src/app_service/service/accounts/service.nim @@ -58,6 +58,12 @@ method init*(self: Service) = except Exception as e: error "error: ", methodName="init", errName = e.name, errDesription = e.msg +method clear*(self: Service) = + self.generatedAccounts = @[] + self.loggedInAccount = AccountDto() + self.importedAccount = GeneratedAccountDto() + self.isFirstTimeAccountLogin = false + method validateMnemonic*(self: Service, mnemonic: string): string = try: let response = status_go_general.validateMnemonic(mnemonic) diff --git a/src/app_service/service/accounts/service_interface.nim b/src/app_service/service/accounts/service_interface.nim index ea2af5d623..36a54b4bb8 100644 --- a/src/app_service/service/accounts/service_interface.nim +++ b/src/app_service/service/accounts/service_interface.nim @@ -48,4 +48,7 @@ method importMnemonic*(self: ServiceInterface, mnemonic: string): bool {.base.} method login*(self: ServiceInterface, account: AccountDto, password: string): string {.base.} = + raise newException(ValueError, "No implementation available") + +method clear*(self: ServiceInterface) {.base.} = raise newException(ValueError, "No implementation available") \ No newline at end of file