diff --git a/StikJIT/StikJITApp.swift b/StikJIT/StikJITApp.swift index aaeab13..fc43458 100644 --- a/StikJIT/StikJITApp.swift +++ b/StikJIT/StikJITApp.swift @@ -256,12 +256,6 @@ struct HeartbeatApp: App { } } } - - Timer.scheduledTimer(withTimeInterval: 0.5, repeats: true) { timer in - if !isHeartbeat { - startHeartbeatInBackground() - } - } } .overlay( ZStack { @@ -460,6 +454,14 @@ func startHeartbeatInBackground() { if FileManager.default.fileExists(atPath: URL.documentsDirectory.appendingPathComponent("DDI/Image.dmg.trustcache").path) { MountingProgress.shared.pubMount() } + + + Timer.scheduledTimer(withTimeInterval: 0.5, repeats: true) { timer in + if !isHeartbeat { + startHeartbeatInBackground() + timer.invalidate() + } + } } else { print("Error: \(message ?? "") (Code: \(result))")