ios: fix pull to refresh

This commit is contained in:
2026-05-06 22:34:17 -07:00
parent 12b3d8c5ad
commit 1e045db7f4
3 changed files with 61 additions and 5 deletions

View File

@@ -159,10 +159,7 @@ struct SybilSidebarItemList: View {
.padding(10)
}
.refreshable {
await viewModel.refreshVisibleContent(
refreshCollections: true,
refreshSelection: false
)
await viewModel.refreshSidebarCollectionsFromPullToRefresh()
}
}
}

View File

@@ -911,6 +911,23 @@ final class SybilViewModel {
}
}
func refreshSidebarCollectionsFromPullToRefresh() async {
guard isAuthenticated, !isCheckingSession else {
return
}
SybilLog.info(
SybilLog.ui,
"Sidebar pull-to-refresh requested"
)
let preferredSelection = selectedItem
let refreshTask = Task { @MainActor in
await refreshCollections(preferredSelection: preferredSelection, refreshSelection: false)
}
await refreshTask.value
}
func sendComposer() async {
let content = composer.trimmingCharacters(in: .whitespacesAndNewlines)
let attachments = composerAttachments
@@ -1276,7 +1293,9 @@ final class SybilViewModel {
attachToVisibleActiveRunIfNeeded()
}
} catch {
if shouldSuppressInactiveTransportError(error) {
if isCancellation(error) {
SybilLog.debug(SybilLog.app, "Collection refresh cancelled")
} else if shouldSuppressInactiveTransportError(error) {
SybilLog.info(SybilLog.app, "Suppressing collection refresh transport interruption while app is inactive")
} else {
errorMessage = normalizeAPIError(error)