fix: NAS gallery shows backed-up files even when caches are cold
GalleryViewModel.load() now has a three-tier resolution for manifest entries:
1. statusService.lastManifest — in-memory, freshest
2. NASManifestCache disk cache — survives restarts
3. Direct NAS download — fallback when both caches are cold (first launch after install,
or before BackupStatusService reconcile has completed)
The direct download also populates NASManifestCache so subsequent opens are instant.
Also adds GalleryViewModel.bind(to:connection:) which subscribes to
statusService.$lastManifest and automatically reloads gallery items when
BackupStatusService finishes reconciling — gallery updates without manual pull-to-refresh.
Co-Authored-By: Kutesir <kutesir@provoc.ug>
Co-Authored-By: Sentry <sentry@provoc.ug>
This commit is contained in:
@@ -36,6 +36,7 @@ struct GalleryView: View {
|
||||
)
|
||||
}
|
||||
.task {
|
||||
viewModel.bind(to: statusService, connection: store.savedConnection)
|
||||
await viewModel.load(connection: store.savedConnection, statusService: statusService)
|
||||
}
|
||||
.refreshable {
|
||||
|
||||
Reference in New Issue
Block a user