mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Fix another layout loop.
This commit is contained in:
@@ -315,6 +315,7 @@ private struct NavigationTabCoordinatorView<Tag: Hashable>: View {
|
||||
@State private var standardAppearance = UITabBarAppearance()
|
||||
@State private var window: UIWindow?
|
||||
@State private var isFullScreen = true
|
||||
@State private var isRailVisible = true
|
||||
|
||||
var body: some View {
|
||||
tabView
|
||||
@@ -357,10 +358,6 @@ private struct NavigationTabCoordinatorView<Tag: Hashable>: View {
|
||||
return selectedTabDetails?.navigationSplitCoordinator?.columnVisibility ?? .all
|
||||
}
|
||||
|
||||
private var isRailVisible: Bool {
|
||||
selectedTabSplitColumnVisibility != .detailOnly
|
||||
}
|
||||
|
||||
var tabRailLayout: some View {
|
||||
HStack(spacing: 0) {
|
||||
if isRailVisible {
|
||||
@@ -389,6 +386,14 @@ private struct NavigationTabCoordinatorView<Tag: Hashable>: View {
|
||||
isFullScreen = newValue
|
||||
}
|
||||
}
|
||||
.onChange(of: selectedTabSplitColumnVisibility, initial: true) {
|
||||
// The rail consumes width, which feeds back into the split's column visibility (not the
|
||||
// same as flattening everything into the single stack), creating an observation tracking
|
||||
// feedback loop that locks up the app while resizing.
|
||||
//
|
||||
// Use a stored value (instead of a computed value) that is updated on the next run loop to break the loop.
|
||||
DispatchQueue.main.async { isRailVisible = selectedTabSplitColumnVisibility != .detailOnly }
|
||||
}
|
||||
}
|
||||
|
||||
var tabViewLayout: some View {
|
||||
|
||||
Reference in New Issue
Block a user