mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Moves to monitoring changes in scene phase
This commit is contained in:
@@ -16,6 +16,7 @@ struct SceneNavigationView: View {
|
||||
|
||||
#if os(iOS)
|
||||
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
|
||||
@Environment(\.scenePhase) private var scenePhase
|
||||
#endif
|
||||
|
||||
var body: some View {
|
||||
@@ -62,6 +63,13 @@ struct SceneNavigationView: View {
|
||||
.onChange(of: sheetToShow) { value in
|
||||
value != .none ? (showSheet = true) : (showSheet = false)
|
||||
}
|
||||
.onChange(of: scenePhase) { newPhase in
|
||||
if newPhase == .background {
|
||||
#if os(iOS)
|
||||
WidgetDataEncoder.encodeWidgetData()
|
||||
#endif
|
||||
}
|
||||
}
|
||||
.toolbar {
|
||||
|
||||
#if os(macOS)
|
||||
|
||||
Reference in New Issue
Block a user