kopia lustrzana https://github.com/JOSM/MapWithAI
Fix issue with MapWithAI not being enabled as expected
Signed-off-by: Taylor Smock <taylor.smock@kaart.com>pull/1/head
rodzic
015c8c7464
commit
608df6c7f1
|
@ -75,10 +75,11 @@ public class DataAvailability {
|
||||||
jsonParser.next();
|
jsonParser.next();
|
||||||
JsonObject jsonObject = jsonParser.getObject();
|
JsonObject jsonObject = jsonParser.getObject();
|
||||||
for (Entry<String, JsonValue> entry : jsonObject.entrySet()) {
|
for (Entry<String, JsonValue> entry : jsonObject.entrySet()) {
|
||||||
JsonValue parameters = entry.getValue().asJsonObject().getJsonArray("parameters");
|
JsonObject json = entry.getValue().asJsonObject();
|
||||||
DataUrl url = new DataUrl(entry.getKey(), entry.getValue().asJsonObject().getString("url", ""), false,
|
JsonValue parameters = json.getJsonArray("parameters");
|
||||||
|
boolean enabled = json.getBoolean("default", false);
|
||||||
|
DataUrl url = new DataUrl(entry.getKey(), json.getString("url", ""), enabled,
|
||||||
parameters == null ? "[]" : parameters.toString());
|
parameters == null ? "[]" : parameters.toString());
|
||||||
boolean enabled = entry.getValue().asJsonObject().getBoolean("default", false);
|
|
||||||
MapWithAIPreferenceHelper.setMapWithAIUrl(url, enabled, true);
|
MapWithAIPreferenceHelper.setMapWithAIUrl(url, enabled, true);
|
||||||
}
|
}
|
||||||
} catch (JsonException | IOException e) {
|
} catch (JsonException | IOException e) {
|
||||||
|
|
Ładowanie…
Reference in New Issue