mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Fixes #1918 - Revert 1a12c729de521d2dcb664bed6b19a75ec139bede as #617 is no longer reproducible on iOS 18.
This commit is contained in:
committed by
Stefan Ceriu
parent
c888a5b4aa
commit
9697d59710
@@ -412,19 +412,17 @@ class NavigationSplitCoordinator: CoordinatorProtocol, ObservableObject, CustomS
|
|||||||
|
|
||||||
private struct NavigationSplitCoordinatorView: View {
|
private struct NavigationSplitCoordinatorView: View {
|
||||||
@State private var columnVisibility = NavigationSplitViewVisibility.all
|
@State private var columnVisibility = NavigationSplitViewVisibility.all
|
||||||
@State private var isInSplitMode = true
|
|
||||||
|
|
||||||
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
|
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
|
||||||
@Environment(\.scenePhase) private var scenePhase
|
|
||||||
|
|
||||||
@ObservedObject var navigationSplitCoordinator: NavigationSplitCoordinator
|
@ObservedObject var navigationSplitCoordinator: NavigationSplitCoordinator
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
Group {
|
Group {
|
||||||
if isInSplitMode {
|
if horizontalSizeClass == .compact {
|
||||||
navigationSplitView
|
|
||||||
} else {
|
|
||||||
navigationStack
|
navigationStack
|
||||||
|
} else {
|
||||||
|
navigationSplitView
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// This needs to be handled on the top level otherwise sheets
|
// This needs to be handled on the top level otherwise sheets
|
||||||
@@ -450,25 +448,6 @@ private struct NavigationSplitCoordinatorView: View {
|
|||||||
.animation(.elementDefault, value: navigationSplitCoordinator.overlayPresentationMode)
|
.animation(.elementDefault, value: navigationSplitCoordinator.overlayPresentationMode)
|
||||||
.animation(.elementDefault, value: navigationSplitCoordinator.overlayModule)
|
.animation(.elementDefault, value: navigationSplitCoordinator.overlayModule)
|
||||||
}
|
}
|
||||||
// Handle `horizontalSizeClass` changes breaking the navigation bar
|
|
||||||
// https://github.com/element-hq/element-x-ios/issues/617
|
|
||||||
.onChange(of: horizontalSizeClass) { _, newValue in
|
|
||||||
guard scenePhase != .background else {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
isInSplitMode = newValue == .regular
|
|
||||||
}
|
|
||||||
.onChange(of: scenePhase) { _, newValue in
|
|
||||||
guard newValue == .active else {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
isInSplitMode = horizontalSizeClass == .regular
|
|
||||||
}
|
|
||||||
.task {
|
|
||||||
isInSplitMode = horizontalSizeClass == .regular
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The NavigationStack that will be used in compact layouts
|
/// The NavigationStack that will be used in compact layouts
|
||||||
|
|||||||
Reference in New Issue
Block a user