26 lines
704 B
Swift
26 lines
704 B
Swift
import SwiftfulRouting
|
|
import SwiftUI
|
|
|
|
struct RootView: View {
|
|
@EnvironmentObject var clientsStore: ClientsStore
|
|
@EnvironmentObject var globalSettingsStore: GlobalSettingsStore
|
|
|
|
var body: some View {
|
|
Group {
|
|
if clientsStore.ready {
|
|
if clientsStore.clients.isEmpty || globalSettingsStore.credentials.allSatisfy({ !$0.isActive }) {
|
|
RouterView { _ in
|
|
WelcomeScreen()
|
|
}
|
|
} else {
|
|
RouterView { _ in
|
|
MainTabScreen()
|
|
}
|
|
}
|
|
} else {
|
|
StartScreen()
|
|
}
|
|
}
|
|
}
|
|
}
|