Skip to content

Commit

Permalink
Delete snapshotDelay as the same can be achieved with the already exi…
Browse files Browse the repository at this point in the history
…sting .snapshot(delay:)
  • Loading branch information
stefanceriu committed Oct 19, 2023
1 parent 39033ab commit 42d28e1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
15 changes: 0 additions & 15 deletions ElementX/Sources/Other/TestablePreview.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 42d28e1

Please sign in to comment.