Check whether the default account is null when the core state is ON to set the hasDefaultAccount value

This commit is contained in:
Benoit Martins 2024-05-06 10:15:36 +02:00
parent 7da5b9567f
commit 4eafaa1dc6

View file

@ -115,7 +115,7 @@ final class CoreContext: ObservableObject {
self.mCoreSuscriptions.insert(self.mCore.publisher?.onGlobalStateChanged?.postOnMainQueue { (cbVal: (core: Core, state: GlobalState, message: String)) in
if cbVal.state == GlobalState.On {
self.hasDefaultAccount = true
self.hasDefaultAccount = self.mCore.defaultAccount != nil ? true : false
self.coreIsStarted = true
} else if cbVal.state == GlobalState.Off {
self.hasDefaultAccount = false