SwiftUI: Can't Show view

First Time: I detect beacons, Alert is displayed, to Show Artwork. But when I detect the beacons a second time, Alert not showing and the display of the screen is white

I am new in swiftui, Please forgive me if I make a few mistakes My English isn’t so great.

**Thanks! Any help would be deeply appreciated! **

When you post code, please post code, not a screenshot. It is impossible to copy the code for testing. And we miss some code.

So please, resend with the full code.

shwoAlert is never set to false. Is it intentional ?

Note that in Swift, this

if showDetail == false {

would better be written

if !showDetail {

@Claude31 this full code

import CoreLocation
import SwiftUI

struct ContentView: View {
  @ObservedObject var detector = BeaconDetector()
  @EnvironmentObject var popupManager: PopupManager
  @EnvironmentObject var authViewModel: AuthViewModel

  @State var isNavigationBarHidden: Bool = true
  @State var isShowAlert = true
  @State var showDetail = false

  var artworkinfo: Artworkinfo
  var exhibition: Exhibition
//  var artwork: Artwork

  @StateObject var artwork = ArtworkViewModel()
  @State private var showSecondView = false

  var body: some View {
    VStack {
      Group {
        // no logged in
        if authViewModel.userSession == nil {
          LoginView()
        } else {
          // logged in user
          if detector.lastDistance == .immediate {
            if showDetail == false {
              Text("")
                .alert(isPresented: $isShowAlert) {
                  Alert(
                    title: Text("Hi! Art Lovers"),
                    message: Text("We want to help you find your nearest Artwork 🖼️"),
                    dismissButton:
                    .default(Text("OK"),
                         action: {
                           self.showDetail = true
                         }
                    )
                  )
                }
            } else {
              let getArtwork = artwork.artworks.filter { $0.id == "1" }.first
              if getArtwork?.uuidbeacon == BeaconDetector.getBeaconID() {
                NavigationLink(destination: ArtworkInfoBeacon(artwork: getArtwork!), isActive: self.$showDetail) {
                  ArtworkInfoBeacon(artwork: getArtwork!)
                }
              }
            }

          } else {
            mainInterfaceView
          }
        }
      } // Group
    } // vStack
  } // some view

//  func alertDetector() -> EmptyView {
//    showDetail = false
//    return EmptyView()
//  }
}

struct ContentView_Previews: PreviewProvider {
  static var previews: some View {
    ContentView(artworkinfo: Artworkinfo(
      id: 0,
      atwName: "Anthropocene",
      atwArtist: "Sirawich",
      ateCate: "Painting",
      atwDesc: "It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal",
      atwSound: "mp4",
      atwImg: "AnthropoceneCover",
      idExhbt: 0), exhibition: Exhibition(id: "", exhbtstate: "", exhbtname: "", exhbtstr: "", exhbtend: "", exhbtdesc: "", timestr: "", timeend: "", exhbtorgnz: "", loctname: "", loctdetail: "", ticket: "", imgcover: ""), artwork: ArtworkViewModel())
  }
}

extension ContentView {
  var mainInterfaceView: some View {
    VStack {
      MainTabView()
    }
  }
}
SwiftUI: Can't Show view
 
 
Q