From 551c4a96fefe7986cb4f79e2984756ad7c4e122e Mon Sep 17 00:00:00 2001 From: Faucon <49079695+FauconSpartiate@users.noreply.github.com> Date: Wed, 28 Jun 2023 16:27:38 +0200 Subject: [PATCH] Refresh every 30s --- .../HaystackApp/Views/OpenHaystackMainView.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OpenHaystack/OpenHaystack/HaystackApp/Views/OpenHaystackMainView.swift b/OpenHaystack/OpenHaystack/HaystackApp/Views/OpenHaystackMainView.swift index 0ef144e5..1b05ce7b 100644 --- a/OpenHaystack/OpenHaystack/HaystackApp/Views/OpenHaystackMainView.swift +++ b/OpenHaystack/OpenHaystack/HaystackApp/Views/OpenHaystackMainView.swift @@ -185,6 +185,15 @@ struct OpenHaystackMainView: View { self.checkPluginIsRunning(nil) } + update() + } + + func update(){ + DispatchQueue.main.asyncAfter(deadline: .now() + 30) + { + self.downloadLocationReports() + update() + } } /// Download the location reports for all current accessories. Shows an error if something fails, like plug-in is missing