WIP - Information for locations.

Better configuration menu.
Testing retrieving JSON from GitHub (uploading).
This commit is contained in:
2022-10-15 18:46:49 +02:00
parent fa25e3c983
commit 9098f42a93
13 changed files with 388 additions and 72 deletions
+23 -3
View File
@@ -12,7 +12,9 @@ export default class Preferences {
static get(key) {
const config = this._getConfig();
return config[key];
const value = config[key];
if (value === undefined) return this._getFromDefault(key);
return value;
}
static save(config) {
@@ -33,15 +35,33 @@ export default class Preferences {
return JSON.parse(storageConfig);
}
static _getFromDefault(key) {
const defaultPreferences = this._default();
return defaultPreferences[key];
}
static _default() {
return {
enabled: true,
'max-price': 120_000,
'max-price-per-meter': 1_500,
percentages: true,
percentages_20: true,
percentages_30: true,
percentages_50: false,
garage: false,
exterior: true,
lift: true,
'max-price': 120_000,
'max-price-per-meter': 1_500
bus: false,
train: false,
supermarket: true,
smoke: false,
pharmacy: true,
gym: false,
pool: true
}
}