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