summaryrefslogtreecommitdiff
path: root/Hutch/App/AppState.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-03-19 01:17:49 -0500
committerChristian Cleberg <[email protected]>2026-03-19 01:17:49 -0500
commit441b69afae30ee6b662be38004fd7b5de1e47302 (patch)
tree610827d41c7e7157290727b69b320f8dce95f08f /Hutch/App/AppState.swift
parentffc0ef0988b5e7d01951c23af85a1cf026b3da9f (diff)
downloadhutch-441b69afae30ee6b662be38004fd7b5de1e47302.tar.gz
hutch-441b69afae30ee6b662be38004fd7b5de1e47302.tar.bz2
hutch-441b69afae30ee6b662be38004fd7b5de1e47302.zip
feat: add support for reading inbox messages (emails) and replying in-app
Diffstat (limited to 'Hutch/App/AppState.swift')
-rw-r--r--Hutch/App/AppState.swift14
1 files changed, 14 insertions, 0 deletions
diff --git a/Hutch/App/AppState.swift b/Hutch/App/AppState.swift
index 624c78d..7492fa6 100644
--- a/Hutch/App/AppState.swift
+++ b/Hutch/App/AppState.swift
@@ -7,6 +7,15 @@ import WebKit
@MainActor
final class AppState {
+ enum Tab: Hashable {
+ case home
+ case inbox
+ case repositories
+ case builds
+ case tickets
+ case settings
+ }
+
enum AuthPhase {
/// App just launched, checking for an existing token.
case launching
@@ -25,6 +34,8 @@ final class AppState {
authPhase == .authenticated && currentUser != nil
}
+ var selectedTab: Tab = .home
+
// MARK: - Current user (populated after successful validation)
private(set) var currentUser: User?
@@ -94,6 +105,7 @@ final class AppState {
await clearWebData()
clearWebContentRenderCaches()
authPhase = .unauthenticated
+ selectedTab = .home
}
func resetAppData() async {
@@ -108,6 +120,7 @@ final class AppState {
clearWebContentRenderCaches()
authPhase = .unauthenticated
+ selectedTab = .home
}
// MARK: - Deep link resolution
@@ -208,6 +221,7 @@ final class AppState {
client.responseCache.clear()
currentUser = nil
pendingDeepLink = nil
+ selectedTab = .home
}
private func clearWebData() async {