apps: refresh App Browser after reconnect (#200)

This commit is contained in:
TastyHeadphones
2026-03-13 02:11:48 +09:00
committed by GitHub
parent 4b052cc1ca
commit 3fb8245001
2 changed files with 6 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ class VPhoneAppBrowserModel {
defer { isLoading = false }
do {
apps = try await control.appList(filter: filter.rawValue)
error = nil
} catch {
self.error = "\(error)"
}

View File

@@ -22,6 +22,11 @@ struct VPhoneAppBrowserView: View {
}
.searchable(text: $model.searchText, prompt: "Filter by name or bundle ID")
.task { await model.refresh() }
.onChange(of: model.control.isConnected) { _, connected in
if connected {
Task { await model.refresh() }
}
}
.alert(
"Error",
isPresented: .init(