28 lines
639 B
Swift
28 lines
639 B
Swift
import SwiftfulRouting
|
|
import SwiftUI
|
|
|
|
struct RootView: View {
|
|
@EnvironmentObject var clientsStore: ClientsStore
|
|
|
|
var body: some View {
|
|
Group {
|
|
if clientsStore.ready {
|
|
if clientsStore.clients.isEmpty {
|
|
RouterView { _ in
|
|
WelcomeScreen()
|
|
}
|
|
} else {
|
|
RouterView { _ in
|
|
MainTabScreen()
|
|
}
|
|
}
|
|
} else {
|
|
StartScreen()
|
|
}
|
|
}
|
|
.task {
|
|
clientsStore.startFetching()
|
|
}
|
|
}
|
|
}
|