Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion defaultmodules/weather/node_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ module.exports = NodeHelper.create({
Log.log(`Attempting to initialize provider ${identifier} for instance ${instanceId}`);

if (this.providers[instanceId]) {
Log.log(`Weather provider ${identifier} already initialized for instance ${instanceId}`);
Log.log(`Weather provider ${identifier} already initialized for instance ${instanceId}, re-sending WEATHER_INITIALIZED`);
// Client may have restarted (e.g. page reload) - re-send so it recovers location name
this.sendSocketNotification("WEATHER_INITIALIZED", {
instanceId,
locationName: this.providers[instanceId].locationName
});
return;
}

Expand Down
4 changes: 2 additions & 2 deletions defaultmodules/weather/weather.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ Module.register("weather", {
this.config.showHumidity = this.config.showHumidity ? "wind" : "none";
}

// All providers run server-side: generate unique instance ID and initialize via node_helper
this.instanceId = `${this.identifier}_${Date.now()}`;
// All providers run server-side: use stable identifier so reconnects don't spawn duplicate HTTPFetchers
this.instanceId = this.identifier;

if (window.initWeatherTheme) window.initWeatherTheme(this);

Expand Down
Loading