summaryrefslogtreecommitdiff
path: root/Rune/App
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-04-11 11:48:40 -0500
committerChristian Cleberg <[email protected]>2026-04-11 11:48:40 -0500
commitfcf864a15b70e4ecb5bd789b1db3116221c34394 (patch)
treef15315324b9f95286b6bf7392dd0ccaee210c2de /Rune/App
parentcf587aa0573ac4f34e1effe70108a9eca82093ac (diff)
downloadrune-fcf864a15b70e4ecb5bd789b1db3116221c34394.tar.gz
rune-fcf864a15b70e4ecb5bd789b1db3116221c34394.tar.bz2
rune-fcf864a15b70e4ecb5bd789b1db3116221c34394.zip
add FUNDING.yml
Diffstat (limited to 'Rune/App')
-rw-r--r--Rune/App/RuneApp.swift25
1 files changed, 16 insertions, 9 deletions
diff --git a/Rune/App/RuneApp.swift b/Rune/App/RuneApp.swift
index 8c63dd6..1709532 100644
--- a/Rune/App/RuneApp.swift
+++ b/Rune/App/RuneApp.swift
@@ -50,23 +50,30 @@ private struct RootView: View {
}
.task {
await settingsViewModel.bootstrap()
+ await syncAuthenticatedState()
}
- .task(id: settingsViewModel.isAuthenticated) {
- guard let client = settingsViewModel.client else {
- domainViewModel.reset()
- tokenViewModel.reset()
- selectedTab = 0
- return
+ .onChange(of: settingsViewModel.client) { _, _ in
+ Task {
+ await syncAuthenticatedState()
}
-
- await domainViewModel.loadDomains(client: client)
- await tokenViewModel.loadTokens(client: client)
}
.fullScreenCover(isPresented: onboardingBinding) {
OnboardingView(viewModel: settingsViewModel)
}
}
+ private func syncAuthenticatedState() async {
+ guard let client = settingsViewModel.client else {
+ domainViewModel.reset()
+ tokenViewModel.reset()
+ selectedTab = 0
+ return
+ }
+
+ await domainViewModel.loadDomains(client: client)
+ await tokenViewModel.loadTokens(client: client)
+ }
+
private var onboardingBinding: Binding<Bool> {
Binding(
get: { settingsViewModel.requiresOnboarding },