From 270162733f5dbf0e9555a29dbdbeae4f9572b82b Mon Sep 17 00:00:00 2001 From: Jens Lody Date: Wed, 8 Jan 2014 19:01:40 +0100 Subject: [PATCH] Reparse data on each connect-event, if the network is available. This should (hopefully) only lead to one reload from the server. In any case, the weather data will be reloaded immediately after reconnection (if the server can be reached). --- src/extension.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/extension.js b/src/extension.js index 3c63db0..1327a6d 100644 --- a/src/extension.js +++ b/src/extension.js @@ -360,11 +360,9 @@ const WeatherMenuButton = new Lang.Class({ }, _checkConnectionState: function() { - let connected = this._network_monitor.network_available; - // only reparse once (we can get multiple connect events) - if (connected && !this._connected) + this._connected = this._network_monitor.network_available; + if (this._connected) this.parseWeatherCurrent(); - this._connected = connected; }, locationChanged: function() { @@ -1415,7 +1413,6 @@ weather-storm.png = weather-storm-symbolic.svg } else { // we are connected, but get no (or no correct) data, so invalidate // the shown data and reload after 10 minutes (recommendded by openweathermap.org) - // this.currentWeatherCache = undefined; this.rebuildCurrentWeatherUi(); this.reloadWeatherCurrent(600); } @@ -1548,7 +1545,6 @@ weather-storm.png = weather-storm-symbolic.svg } else { // we are connected, but get no (or no correct) data, so invalidate // the shown data and reload after 10 minutes (recommendded by openweathermap.org) - // this.forecastWeatherCache = undefined; this.rebuildFutureWeatherUi(); this.reloadWeatherForecast(600); }