🐛 Fix some production issue for watchOS Solian

This commit is contained in:
2025-10-31 23:09:08 +08:00
parent 7f971bcee3
commit a2b0cd0b6a
5 changed files with 44 additions and 13 deletions

View File

@@ -9,7 +9,7 @@ import SwiftUI
// The main view with the TabView for filtering.
struct ExploreView: View {
@StateObject private var appState = AppState()
@EnvironmentObject private var appState: AppState
@State private var isComposing = false
@State private var selectedTab: String = "Explore"
@@ -46,14 +46,22 @@ struct ExploreView: View {
}
}
}
.environmentObject(appState)
} else {
ProgressView { Text("Connecting to phone...") }
VStack {
ProgressView { Text("Syncing...") }
Button("Retry") {
appState.requestData()
}
}
}
}
.sheet(isPresented: $isComposing) {
ComposePostView()
.environmentObject(appState)
}
.alert("Error", isPresented: .constant(appState.errorMessage != nil), actions: {
Button("OK") { appState.errorMessage = nil }
}, message: {
Text(appState.errorMessage ?? "")
})
}
}