Skip to content

Commit

Permalink
plusonelabs#356 Fix Restore both settings and a Snapshot of events
Browse files Browse the repository at this point in the history
  • Loading branch information
yvolk committed Jan 11, 2020
1 parent 5baaab0 commit 77846f1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ public InstanceSettings getSettingsForWidget(Context context, InstanceSettings s
JSONObject jsonSettings = jsonData.optJSONObject(KEY_SETTINGS);
if (jsonSettings == null) return InstanceSettings.EMPTY;

InstanceSettings settings = InstanceSettings.fromJson(context, storedSettings, jsonSettings);

InstanceSettings originalSettings = InstanceSettings.fromJson(context, storedSettings, jsonSettings);
InstanceSettings targetSettings = originalSettings.asForWidget(context, targetWidgetId);
QueryResultsStorage results = QueryResultsStorage.fromJson(targetWidgetId, jsonData);
if (!results.getResults().isEmpty()) {
settings.setResultsStorage(results);
targetSettings.setResultsStorage(results);
}
return settings.asForWidget(context, targetWidgetId);
return targetSettings;
}

}

0 comments on commit 77846f1

Please sign in to comment.