[#1202] View for covering Zashi prevents from seeing the seed

- The cover view is now an overlay instead of a switch to a different view
- The animation of the overlay needed to be removed so it's processed until the app is suspended
- The cover is now processed for background notification only, inactive has been removed to never show during system overlays like face ID, etc.
This commit is contained in:
Lukas Korba 2024-04-17 14:16:29 +02:00
parent e5ec490421
commit 6a8b0d5b50
1 changed files with 11 additions and 17 deletions

View File

@ -28,26 +28,20 @@ public struct RootView: View {
}
public var body: some View {
Group {
if covered {
VStack {
ZashiIcon()
.scaleEffect(2.0)
.padding(.bottom, 180)
switchOverDestination()
.overlay {
if covered {
VStack {
ZashiIcon()
.scaleEffect(2.0)
.padding(.bottom, 180)
}
.applyScreenBackground()
}
.applyScreenBackground()
} else {
switchOverDestination()
}
}
.onChange(of: scenePhase) { value in
switch value {
case .active:
withAnimation { covered = false }
default:
withAnimation { covered = true }
.onChange(of: scenePhase) { value in
covered = value == .background
}
}
}
}