fix(@desktop/onboarding): startup stuck when entering wrong password

Fixes: #6812
This commit is contained in:
Sale Djenic 2022-08-05 10:52:29 +02:00 committed by Jonathan Rainville
parent 68d577aa5d
commit 55cb3c3757
3 changed files with 13 additions and 7 deletions

View File

@ -68,7 +68,7 @@ proc newController*(delegate: io_interface.AccessInterface,
result.tmpRecoverUsingSeedPhraseWhileLogin = false result.tmpRecoverUsingSeedPhraseWhileLogin = false
# Forward declaration # Forward declaration
proc cleanTmpData(self: Controller) proc cleanTmpData*(self: Controller)
proc delete*(self: Controller) = proc delete*(self: Controller) =
discard discard
@ -77,7 +77,6 @@ proc init*(self: Controller) =
self.events.on(SignalType.NodeLogin.event) do(e:Args): self.events.on(SignalType.NodeLogin.event) do(e:Args):
let signal = NodeSignal(e) let signal = NodeSignal(e)
self.delegate.onNodeLogin(signal.event.error) self.delegate.onNodeLogin(signal.event.error)
self.cleanTmpData()
self.events.on(SignalType.NodeStopped.event) do(e:Args): self.events.on(SignalType.NodeStopped.event) do(e:Args):
self.events.emit("nodeStopped", Args()) self.events.emit("nodeStopped", Args())
@ -191,7 +190,7 @@ proc setRecoverUsingSeedPhraseWhileLogin*(self: Controller, value: bool) =
proc getRecoverUsingSeedPhraseWhileLogin*(self: Controller): bool = proc getRecoverUsingSeedPhraseWhileLogin*(self: Controller): bool =
return self.tmpRecoverUsingSeedPhraseWhileLogin return self.tmpRecoverUsingSeedPhraseWhileLogin
proc cleanTmpData(self: Controller) = proc cleanTmpData*(self: Controller) =
self.tmpSelectedLoginAccountKeyUid = "" self.tmpSelectedLoginAccountKeyUid = ""
self.tmpProfileImageDetails = ProfileImageDetails() self.tmpProfileImageDetails = ProfileImageDetails()
self.tmpKeychainErrorOccurred = true self.tmpKeychainErrorOccurred = true

View File

@ -222,10 +222,12 @@ method onNodeLogin*[T](self: Module[T], error: string) =
quit() # quit the app quit() # quit the app
if error.len == 0: if error.len == 0:
self.controller.cleanTmpData()
self.delegate.userLoggedIn() self.delegate.userLoggedIn()
if currStateObj.flowType() != FlowType.AppLogin: if currStateObj.flowType() != FlowType.AppLogin:
self.controller.storeIdentityImage() self.controller.storeIdentityImage()
else: else:
self.view.setAppState(AppState.StartupState)
if currStateObj.flowType() == FlowType.AppLogin: if currStateObj.flowType() == FlowType.AppLogin:
self.emitAccountLoginError(error) self.emitAccountLoginError(error)
else: else:

View File

@ -130,8 +130,14 @@ StatusWindow {
} }
function onAppStateChanged(state) { function onAppStateChanged(state) {
if(state === Constants.appState.appLoading) { if(state === Constants.appState.startup) {
// we're here only in case of error when we're returning from the app loading state
loader.sourceComponent = undefined
startupOnboarding.visible = true
}
else if(state === Constants.appState.appLoading) {
loader.sourceComponent = appLoadingAnimation loader.sourceComponent = appLoadingAnimation
startupOnboarding.visible = false
} }
else if(state === Constants.appState.main) { else if(state === Constants.appState.main) {
// We set main module to the Global singleton once user is logged in and we move to the main app. // We set main module to the Global singleton once user is logged in and we move to the main app.
@ -150,10 +156,9 @@ StatusWindow {
if (localAccountSensitiveSettings.hiddenCommunityBackUpBanners === "") { if (localAccountSensitiveSettings.hiddenCommunityBackUpBanners === "") {
localAccountSensitiveSettings.hiddenCommunityBackUpBanners = []; localAccountSensitiveSettings.hiddenCommunityBackUpBanners = [];
} }
startupOnboarding.unload()
startupOnboarding.visible = false
} }
startupOnboarding.unload()
startupOnboarding.visible = false
} }
} }