22 lines
515 B
Swift
22 lines
515 B
Swift
import SwiftUI
|
|
|
|
struct ContentView: View {
|
|
@EnvironmentObject var authViewModel: AuthViewModel
|
|
|
|
var body: some View {
|
|
Group {
|
|
if authViewModel.isCheckingAuth {
|
|
Color(.systemBackground)
|
|
.ignoresSafeArea()
|
|
} else if authViewModel.isAuthenticated {
|
|
NotificationsView()
|
|
} else {
|
|
LoginView()
|
|
}
|
|
}
|
|
.task {
|
|
await authViewModel.checkAuthStatus()
|
|
}
|
|
}
|
|
}
|