Add OS metadata, preference hooks, and slider polish
This commit is contained in:
@@ -10,16 +10,19 @@ import SwiftUI
|
||||
struct ServerDetailView: View {
|
||||
@Binding var server: Server
|
||||
var isFetching: Bool
|
||||
@AppStorage("showIntervalIndicator") private var showIntervalIndicator: Bool = true
|
||||
|
||||
@State private var progress: Double = 0
|
||||
let timer = Timer.publish(every: 1.0 / 60.0, on: .main, in: .common).autoconnect()
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 0) {
|
||||
ProgressView(value: progress)
|
||||
.progressViewStyle(LinearProgressViewStyle())
|
||||
.padding(.horizontal)
|
||||
.frame(height: 2)
|
||||
if showIntervalIndicator {
|
||||
ProgressView(value: progress)
|
||||
.progressViewStyle(LinearProgressViewStyle())
|
||||
.padding(.horizontal)
|
||||
.frame(height: 2)
|
||||
}
|
||||
|
||||
if server.info == nil {
|
||||
ProgressView("Fetching server info...")
|
||||
@@ -54,6 +57,7 @@ struct ServerDetailView: View {
|
||||
}
|
||||
}
|
||||
.onReceive(timer) { _ in
|
||||
guard showIntervalIndicator else { return }
|
||||
withAnimation(.linear(duration: 1.0 / 60.0)) {
|
||||
progress += 1.0 / (60.0 * 60.0)
|
||||
if progress >= 1 { progress = 0 }
|
||||
|
||||
Reference in New Issue
Block a user