Merge pull request #1203 from LukasKorba/1202-View-for-covering-Zashi-prevents-from-seeing-the-seed

[#1202] View for covering Zashi prevents from seeing the seed
This commit is contained in:
Lukas Korba 2024-04-17 14:32:33 +02:00 committed by GitHub
commit 52017ab435
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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
}
}
}
}