gitbay/Push/PushRouter.swift
19 lines · 692 bytes
1import Observation
2
3/// Carries a tapped notification's destination into the view tree.
4///
5/// Owned by `gitbayApp`, above `ContentView`. The `TabView` inside
6/// `ContentView` carries `.id(account.id)`, so the account switch a
7/// cross-account tap performs tears that subtree down and rebuilds it.
8/// A target held inside would go with it; held here, the rebuilt tree
9/// drains it.
10///
11/// The `.id` is on the `TabView`, not on `ContentView` itself, so
12/// `ContentView`'s own `@State` survives the switch — which is why the
13/// Dashboard path is reset explicitly in the drain rather than by
14/// identity.
15@Observable
16@MainActor
17final class PushRouter {
18 var pending: PushTarget?
19}