pushdeer/ios/PushDeer-iOS/PushDeer/ContentView.swift

30 lines
482 B
Swift
Raw Normal View History

2021-12-27 22:33:27 +08:00
//
// ContentView.swift
// PushDeer
//
// Created by HEXT on 2021/12/25.
//
import SwiftUI
struct ContentView: View {
@EnvironmentObject private var store: AppState
2021-12-27 22:33:27 +08:00
var body: some View {
if Env.isSelfHosted && store.api_endpoint.isEmpty {
EndpointView()
} else if store.token.isEmpty {
LoginView()
} else {
MainView()
}
2021-12-27 22:33:27 +08:00
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}