mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-12-02 18:12:11 +00:00
initialize missing settings
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
import Map from '$lib/components/map/Map.svelte';
|
||||
import LayerControl from '$lib/components/map/layer-control/LayerControl.svelte';
|
||||
import OpenIn from '$lib/components/embedding/OpenIn.svelte';
|
||||
import { readable, writable } from 'svelte/store';
|
||||
import { writable } from 'svelte/store';
|
||||
import type { GPXFile } from 'gpx';
|
||||
import {
|
||||
allowedEmbeddingBasemaps,
|
||||
@@ -17,7 +17,6 @@
|
||||
import { settings } from '$lib/logic/settings';
|
||||
import { fileStateCollection } from '$lib/logic/file-state';
|
||||
import { gpxStatistics, slicedGPXStatistics } from '$lib/logic/statistics';
|
||||
import { GPXStatisticsTree } from '$lib/logic/statistics-tree';
|
||||
import { loadFile } from '$lib/logic/file-actions';
|
||||
import { selection } from '$lib/logic/selection';
|
||||
import { untrack } from 'svelte';
|
||||
@@ -41,6 +40,8 @@
|
||||
directionMarkers,
|
||||
} = settings;
|
||||
|
||||
settings.initialize();
|
||||
|
||||
function applyOptions() {
|
||||
let downloads: Promise<GPXFile | null>[] = getFilesFromEmbeddingOptions(options).map(
|
||||
(url) => {
|
||||
|
||||
@@ -98,6 +98,10 @@ export class SettingInitOnFirstRead<V> {
|
||||
});
|
||||
}
|
||||
|
||||
initialize() {
|
||||
this.set(this._initial);
|
||||
}
|
||||
|
||||
disconnectFromDatabase() {
|
||||
this._subscription?.unsubscribe();
|
||||
this._subscription = null;
|
||||
@@ -174,4 +178,12 @@ export const settings = {
|
||||
}
|
||||
}
|
||||
},
|
||||
initialize() {
|
||||
for (const key in settings) {
|
||||
const setting = (settings as any)[key];
|
||||
if (setting instanceof SettingInitOnFirstRead) {
|
||||
setting.initialize();
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user