Skip to content

Commit 091b810

Browse files
committed
fix: avoid showing sync failed immediately when app comes to foreground
1 parent 26b3644 commit 091b810

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Bitkit/Utilities/ScenePhase.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ private struct HandleLightningStateOnScenePhaseChange: ViewModifier {
2525
Logger.debug("Scene phase changed: \(newPhase)")
2626

2727
if newPhase == .background {
28+
app.resetAppStatusInitialized()
29+
2830
do {
2931
try await stopNodeIfNeeded()
3032
} catch {

Bitkit/ViewModels/AppViewModel.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ class AppViewModel: ObservableObject {
5757
}
5858
}
5959

60+
func resetAppStatusInitialized() {
61+
appStatusInitialized = false
62+
startAppStatusInitializationTimer()
63+
}
64+
6065
private let lightningService: LightningService
6166
private let coreService: CoreService
6267
private let sheetViewModel: SheetViewModel

0 commit comments

Comments
 (0)