Remove eraseToStream now that any AsyncSequence is available to us. (#4836)

* Remove `eraseToStream` now that `any AsyncSequence` is available to us.

* Remove the now unnecessary backport of Mutex.

* Silence a couple more deprecation warnings.
This commit is contained in:
Doug
2025-12-10 18:33:15 +00:00
committed by GitHub
parent 13f04d76f7
commit d130dffaf3
26 changed files with 81 additions and 170 deletions
@@ -127,26 +127,26 @@ struct SecureBackupLogoutConfirmationScreen_Previews: PreviewProvider, TestableP
SecureBackupLogoutConfirmationScreen(context: waitingViewModel.context)
}
.previewDisplayName("Waiting")
.snapshotPreferences(expect: waitingViewModel.context.observe(\.viewState.mode).map { $0 == .waitingToStart(hasStalled: false) }.eraseToStream())
.snapshotPreferences(expect: waitingViewModel.context.observe(\.viewState.mode).map { $0 == .waitingToStart(hasStalled: false) })
NavigationStack {
SecureBackupLogoutConfirmationScreen(context: ongoingViewModel.context)
}
.previewDisplayName("Ongoing")
.snapshotPreferences(expect: ongoingViewModel.context.observe(\.viewState.mode).map { $0 == .backupOngoing(progress: 0.5) }.eraseToStream())
.snapshotPreferences(expect: ongoingViewModel.context.observe(\.viewState.mode).map { $0 == .backupOngoing(progress: 0.5) })
// Uses the same view model as Waiting but with a different expectation.
NavigationStack {
SecureBackupLogoutConfirmationScreen(context: waitingViewModel.context)
}
.previewDisplayName("Stalled")
.snapshotPreferences(expect: waitingViewModel.context.observe(\.viewState.mode).map { $0 == .waitingToStart(hasStalled: true) }.eraseToStream())
.snapshotPreferences(expect: waitingViewModel.context.observe(\.viewState.mode).map { $0 == .waitingToStart(hasStalled: true) })
NavigationStack {
SecureBackupLogoutConfirmationScreen(context: offlineViewModel.context)
}
.previewDisplayName("Offline")
.snapshotPreferences(expect: offlineViewModel.context.observe(\.viewState.mode).map { $0 == .offline }.eraseToStream())
.snapshotPreferences(expect: offlineViewModel.context.observe(\.viewState.mode).map { $0 == .offline })
}
static func makeViewModel(mode: SecureBackupLogoutConfirmationScreenViewMode) -> SecureBackupLogoutConfirmationScreenViewModel {