Skip to content

Commit

Permalink
[Misc] Fix a bug that caused game screen to blank out on iOS pre-16.4.
Browse files Browse the repository at this point in the history
https://developer.apple.com/documentation/ios-ipados-release-notes/ios-ipados-16_4-release-notes
Fixed: Navigation destinations with data dependencies captured from ancestor views update more reliably. (103429535)
  • Loading branch information
honganhkhoa committed Jun 24, 2024
1 parent a8e40bf commit a11755e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Surround/Views/GameDetail/GameDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,16 @@ struct GameDetailView: View {
}

var body: some View {
guard let currentGame = currentGame else {
guard let currentGame = self.currentGame else {
// Work-around for pre-iOS 16.4 bug related navigation destination with data dependencies captured from ancestor views.
if let currentGameFromNav = nav.home.activeGame {
DispatchQueue.main.async {
self.currentGame = currentGameFromNav
}
}
return AnyView(EmptyView())
}

var compactLayout = true
#if os(iOS)
compactLayout = horizontalSizeClass == .compact
Expand Down

0 comments on commit a11755e

Please sign in to comment.