Commit 82fc54c7 by Demid Merzlyakov

Greatly optimize weather updates.

parent d2321de6
...@@ -53,6 +53,7 @@ public class LocationManager { ...@@ -53,6 +53,7 @@ public class LocationManager {
self?._locations = locations self?._locations = locations
self?._selectedLocationIndex = selectedIndex self?._selectedLocationIndex = selectedIndex
self?.handleLocationsChange(locationsChanged: true, selectedLocationChanged: true) self?.handleLocationsChange(locationsChanged: true, selectedLocationChanged: true)
self?.updateAllWeatherIfNeeded()
} }
} }
...@@ -72,7 +73,6 @@ public class LocationManager { ...@@ -72,7 +73,6 @@ public class LocationManager {
} }
} }
storage.save(locations: locations, selectedIndex: selectedLocationIndex) storage.save(locations: locations, selectedIndex: selectedLocationIndex)
updateAllWeatherIfNeeded()
} }
public private(set) var locations: [Location] { public private(set) var locations: [Location] {
...@@ -354,6 +354,7 @@ public class LocationManager { ...@@ -354,6 +354,7 @@ public class LocationManager {
selectedLocationIndex = locations.count - 1 selectedLocationIndex = locations.count - 1
} }
} }
updateAllWeatherIfNeeded()
} }
public func addIfNeeded(partialLocation: PartialLocation, selectLocation: Bool) { public func addIfNeeded(partialLocation: PartialLocation, selectLocation: Bool) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment