init
This commit is contained in:
1 parent
558bb005f4
commit
9ed2f17768
14 files changed
+1207
-94
No files matched your search
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// RootView.swift
|
||||
// Snail
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
/// Показывает вход или основной интерфейс в зависимости от состояния сессии.
|
||||
struct RootView: View {
|
||||
@Environment(AuthStore.self) private var auth
|
||||
|
||||
var body: some View {
|
||||
Group {
|
||||
switch auth.state {
|
||||
case .loading:
|
||||
ProgressView()
|
||||
case .signedOut:
|
||||
SignInView()
|
||||
case .signedIn:
|
||||
ProjectListView()
|
||||
}
|
||||
}
|
||||
.animation(.default, value: auth.state)
|
||||
.task { await auth.restoreSession() }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user