diff options
Diffstat (limited to 'Hutch/Views/Home')
| -rw-r--r-- | Hutch/Views/Home/HomeView.swift | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Hutch/Views/Home/HomeView.swift b/Hutch/Views/Home/HomeView.swift index 35e8f7c..f9d3de5 100644 --- a/Hutch/Views/Home/HomeView.swift +++ b/Hutch/Views/Home/HomeView.swift @@ -3,6 +3,7 @@ import SwiftUI struct HomeView: View { @AppStorage(AppStorageKeys.swipeActionsEnabled) private var swipeActionsEnabled = true @Environment(AppState.self) private var appState + @Environment(\.scenePhase) private var scenePhase @State private var viewModel: HomeViewModel? private let previewLimit = 4 private let projectPreviewLimit = 3 @@ -39,6 +40,12 @@ struct HomeView: View { await vm.loadDashboard() } + .onChange(of: scenePhase) { _, newPhase in + guard newPhase == .active, let viewModel else { return } + Task { + await viewModel.loadDashboard() + } + } } @ViewBuilder |
