From 091d7bf5a375d4ae14c5fcbb9adccabf64b83acd Mon Sep 17 00:00:00 2001 From: quadbyte Date: Tue, 12 Aug 2025 10:05:57 -0400 Subject: [PATCH] Formatting Location --- Services/Location.qml | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/Services/Location.qml b/Services/Location.qml index aaf0d40..1c6e3cd 100644 --- a/Services/Location.qml +++ b/Services/Location.qml @@ -77,13 +77,9 @@ Singleton { console.warn("[Location] Why is my latitude empty") } - if ( - (data.weatherLastFetch === "") || - (data.weather === null) || - (data.latitude === "") || - (data.longitude === "") || - (data.name !== Settings.data.location.name) - || (Time.timestamp >= data.weatherLastFetch + weatherUpdateFrequency)) { + if ((data.weatherLastFetch === "") || (data.weather === null) || (data.latitude === "") || (data.longitude === "") + || (data.name !== Settings.data.location.name) + || (Time.timestamp >= data.weatherLastFetch + weatherUpdateFrequency)) { getFreshWeather() } } @@ -91,23 +87,18 @@ Singleton { // -------------------------------- function getFreshWeather() { isFetchingWeather = true - if ( - (data.latitude === "") || - (data.longitude === "") || - (data.name !== Settings.data.location.name)) { + if ((data.latitude === "") || (data.longitude === "") || (data.name !== Settings.data.location.name)) { _geocodeLocation(Settings.data.location.name, function (latitude, longitude) { console.log("[Location] Geocoded " + Settings.data.location.name + " to: " + latitude + " / " + longitude) - // Save location name + // Save location name data.name = Settings.data.location.name // Save GPS coordinates data.latitude = latitude.toString() data.longitude = longitude.toString() - - _fetchWeather(latitude, longitude, errorCallback) }, errorCallback) } else {