diff options
| author | Christian Cleberg <[email protected]> | 2026-03-22 20:40:53 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-03-22 20:40:53 -0500 |
| commit | 3ed2bb4da64d7cc9b67ef86a3892ab41b14fcc51 (patch) | |
| tree | 3194f6f3303f4092715f3467ee3d270c2b26427d /Hutch/App/RootView.swift | |
| parent | 866f9517dba3c878197b0290dd8b4d1becb153c3 (diff) | |
| download | hutch-3ed2bb4da64d7cc9b67ef86a3892ab41b14fcc51.tar.gz hutch-3ed2bb4da64d7cc9b67ef86a3892ab41b14fcc51.tar.bz2 hutch-3ed2bb4da64d7cc9b67ef86a3892ab41b14fcc51.zip | |
feat: surface an alert when a deep link fails to resolve
Diffstat (limited to 'Hutch/App/RootView.swift')
| -rw-r--r-- | Hutch/App/RootView.swift | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/Hutch/App/RootView.swift b/Hutch/App/RootView.swift index f615541..9c4e71a 100644 --- a/Hutch/App/RootView.swift +++ b/Hutch/App/RootView.swift @@ -12,6 +12,8 @@ struct RootView: View { @State private var isResolvingDeepLink = false var body: some View { + @Bindable var appState = appState + Group { switch appState.authPhase { case .launching: @@ -37,6 +39,23 @@ struct RootView: View { .onChange(of: appState.pendingTabNavigation) { _, newValue in consumePendingTabNavigationIfPossible(newValue) } + .alert( + "Couldn't Open Link", + isPresented: Binding( + get: { appState.deepLinkError != nil }, + set: { isPresented in + if !isPresented { + appState.deepLinkError = nil + } + } + ) + ) { + Button("OK") { + appState.deepLinkError = nil + } + } message: { + Text(appState.deepLinkError ?? "") + } } // MARK: - Tab View @@ -198,7 +217,7 @@ struct RootView: View { await settleNavigationTransition() repoPath.append(summary) } catch { - // Silently fail — the repo may not exist or be inaccessible + appState.presentRepositoryDeepLinkError() } } } @@ -221,7 +240,7 @@ struct RootView: View { ticketId: ticketId )) } catch { - // Silently fail + appState.presentTicketDeepLinkError() } } } |
