From 42d28e1fae8cd5c1b4fbefda5dc5a291f1d11390 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 19 Oct 2023 14:05:16 +0300 Subject: [PATCH] Delete snapshotDelay as the same can be achieved with the already existing .snapshot(delay:) --- ElementX/Sources/Other/TestablePreview.swift | 15 --------------- .../View/SecureBackupScreen.swift | 2 +- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/ElementX/Sources/Other/TestablePreview.swift b/ElementX/Sources/Other/TestablePreview.swift index 79585ff685..e138b9cd3e 100644 --- a/ElementX/Sources/Other/TestablePreview.swift +++ b/ElementX/Sources/Other/TestablePreview.swift @@ -19,18 +19,3 @@ import SwiftUI import Prefire protocol TestablePreview: PrefireProvider { } - -extension View { - func snapshotDelay(duration: TimeInterval) -> some View { - modifier(SnapshotDelay(duration: duration)) - } -} - -private struct SnapshotDelay: ViewModifier { - let duration: TimeInterval - - func body(content: Content) -> some View { - content - .preference(key: DelayPreferenceKey.self, value: duration) - } -} diff --git a/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/View/SecureBackupScreen.swift b/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/View/SecureBackupScreen.swift index 6733768e6f..2e6990b6a7 100644 --- a/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/View/SecureBackupScreen.swift +++ b/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/View/SecureBackupScreen.swift @@ -152,7 +152,7 @@ struct SecureBackupScreen_Previews: PreviewProvider, TestablePreview { } .previewDisplayName("Recovery incomplete") } - .snapshotDelay(duration: 0.25) + .snapshot(delay: 0.25) } static func viewModel(keyBackupState: SecureBackupKeyBackupState,