mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-09-05 09:52:54 +00:00
prettier config + format all, closes #175
This commit is contained in:
@@ -1,11 +1,58 @@
|
||||
import Dexie, { liveQuery } from 'dexie';
|
||||
import { GPXFile, GPXStatistics, Track, TrackSegment, Waypoint, TrackPoint, type Coordinates, distance, type LineStyleExtension, type WaypointType } from 'gpx';
|
||||
import { enableMapSet, enablePatches, applyPatches, type Patch, type WritableDraft, freeze, produceWithPatches } from 'immer';
|
||||
import {
|
||||
GPXFile,
|
||||
GPXStatistics,
|
||||
Track,
|
||||
TrackSegment,
|
||||
Waypoint,
|
||||
TrackPoint,
|
||||
type Coordinates,
|
||||
distance,
|
||||
type LineStyleExtension,
|
||||
type WaypointType,
|
||||
} from 'gpx';
|
||||
import {
|
||||
enableMapSet,
|
||||
enablePatches,
|
||||
applyPatches,
|
||||
type Patch,
|
||||
type WritableDraft,
|
||||
freeze,
|
||||
produceWithPatches,
|
||||
} from 'immer';
|
||||
import { writable, get, derived, type Readable, type Writable } from 'svelte/store';
|
||||
import { gpxStatistics, initTargetMapBounds, map, splitAs, updateAllHidden, updateTargetMapBounds } from './stores';
|
||||
import { defaultBasemap, defaultBasemapTree, defaultOverlayTree, defaultOverlays, type CustomLayer, defaultOpacities, defaultOverpassQueries, defaultOverpassTree } from './assets/layers';
|
||||
import { applyToOrderedItemsFromFile, applyToOrderedSelectedItemsFromFile, selection } from '$lib/components/file-list/Selection';
|
||||
import { ListFileItem, ListItem, ListTrackItem, ListLevel, ListTrackSegmentItem, ListWaypointItem, ListRootItem } from '$lib/components/file-list/FileList';
|
||||
import {
|
||||
gpxStatistics,
|
||||
initTargetMapBounds,
|
||||
map,
|
||||
splitAs,
|
||||
updateAllHidden,
|
||||
updateTargetMapBounds,
|
||||
} from './stores';
|
||||
import {
|
||||
defaultBasemap,
|
||||
defaultBasemapTree,
|
||||
defaultOverlayTree,
|
||||
defaultOverlays,
|
||||
type CustomLayer,
|
||||
defaultOpacities,
|
||||
defaultOverpassQueries,
|
||||
defaultOverpassTree,
|
||||
} from './assets/layers';
|
||||
import {
|
||||
applyToOrderedItemsFromFile,
|
||||
applyToOrderedSelectedItemsFromFile,
|
||||
selection,
|
||||
} from '$lib/components/file-list/Selection';
|
||||
import {
|
||||
ListFileItem,
|
||||
ListItem,
|
||||
ListTrackItem,
|
||||
ListLevel,
|
||||
ListTrackSegmentItem,
|
||||
ListWaypointItem,
|
||||
ListRootItem,
|
||||
} from '$lib/components/file-list/FileList';
|
||||
import { updateAnchorPoints } from '$lib/components/toolbar/tools/routing/Simplify';
|
||||
import { SplitType } from '$lib/components/toolbar/tools/scissors/Scissors.svelte';
|
||||
import { getClosestLinePoint, getElevation } from '$lib/utils';
|
||||
@@ -15,17 +62,22 @@ enableMapSet();
|
||||
enablePatches();
|
||||
|
||||
class Database extends Dexie {
|
||||
|
||||
fileids!: Dexie.Table<string, string>;
|
||||
files!: Dexie.Table<GPXFile, string>;
|
||||
patches!: Dexie.Table<{ patch: Patch[], inversePatch: Patch[], index: number }, number>;
|
||||
patches!: Dexie.Table<{ patch: Patch[]; inversePatch: Patch[]; index: number }, number>;
|
||||
settings!: Dexie.Table<any, string>;
|
||||
overpasstiles!: Dexie.Table<{ query: string, x: number, y: number, time: number }, [string, number, number]>;
|
||||
overpassdata!: Dexie.Table<{ query: string, id: number, poi: GeoJSON.Feature }, [string, number]>;
|
||||
overpasstiles!: Dexie.Table<
|
||||
{ query: string; x: number; y: number; time: number },
|
||||
[string, number, number]
|
||||
>;
|
||||
overpassdata!: Dexie.Table<
|
||||
{ query: string; id: number; poi: GeoJSON.Feature },
|
||||
[string, number]
|
||||
>;
|
||||
|
||||
constructor() {
|
||||
super("Database", {
|
||||
cache: 'immutable'
|
||||
super('Database', {
|
||||
cache: 'immutable',
|
||||
});
|
||||
this.version(1).stores({
|
||||
fileids: ',&fileid',
|
||||
@@ -41,10 +93,15 @@ class Database extends Dexie {
|
||||
export const db = new Database();
|
||||
|
||||
// Wrap Dexie live queries in a Svelte store to avoid triggering the query for every subscriber, and updates to the store are pushed to the DB
|
||||
export function bidirectionalDexieStore<K, V>(table: Dexie.Table<V, K>, key: K, initial: V, initialize: boolean = true): Writable<V | undefined> {
|
||||
export function bidirectionalDexieStore<K, V>(
|
||||
table: Dexie.Table<V, K>,
|
||||
key: K,
|
||||
initial: V,
|
||||
initialize: boolean = true
|
||||
): Writable<V | undefined> {
|
||||
let first = true;
|
||||
let store = writable<V | undefined>(initialize ? initial : undefined);
|
||||
liveQuery(() => table.get(key)).subscribe(value => {
|
||||
liveQuery(() => table.get(key)).subscribe((value) => {
|
||||
if (value === undefined) {
|
||||
if (first) {
|
||||
if (!initialize) {
|
||||
@@ -70,11 +127,15 @@ export function bidirectionalDexieStore<K, V>(table: Dexie.Table<V, K>, key: K,
|
||||
if (typeof newValue === 'object' || newValue !== get(store)) {
|
||||
table.put(newValue, key);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function dexieSettingStore<T>(key: string, initial: T, initialize: boolean = true): Writable<T> {
|
||||
export function dexieSettingStore<T>(
|
||||
key: string,
|
||||
initial: T,
|
||||
initialize: boolean = true
|
||||
): Writable<T> {
|
||||
return bidirectionalDexieStore(db.settings, key, initial, initialize);
|
||||
}
|
||||
|
||||
@@ -96,7 +157,11 @@ export const settings = {
|
||||
currentOverlays: dexieSettingStore('currentOverlays', defaultOverlays, false),
|
||||
previousOverlays: dexieSettingStore('previousOverlays', defaultOverlays),
|
||||
selectedOverlayTree: dexieSettingStore('selectedOverlayTree', defaultOverlayTree),
|
||||
currentOverpassQueries: dexieSettingStore('currentOverpassQueries', defaultOverpassQueries, false),
|
||||
currentOverpassQueries: dexieSettingStore(
|
||||
'currentOverpassQueries',
|
||||
defaultOverpassQueries,
|
||||
false
|
||||
),
|
||||
selectedOverpassTree: dexieSettingStore('selectedOverpassTree', defaultOverpassTree),
|
||||
opacities: dexieSettingStore('opacities', defaultOpacities),
|
||||
customLayers: dexieSettingStore<Record<string, CustomLayer>>('customLayers', {}),
|
||||
@@ -107,7 +172,7 @@ export const settings = {
|
||||
streetViewSource: dexieSettingStore('streetViewSource', 'mapillary'),
|
||||
fileOrder: dexieSettingStore<string[]>('fileOrder', []),
|
||||
defaultOpacity: dexieSettingStore('defaultOpacity', 0.7),
|
||||
defaultWidth: dexieSettingStore('defaultWidth', (browser && window.innerWidth < 600) ? 8 : 5),
|
||||
defaultWidth: dexieSettingStore('defaultWidth', browser && window.innerWidth < 600 ? 8 : 5),
|
||||
bottomPanelSize: dexieSettingStore('bottomPanelSize', 170),
|
||||
rightPanelSize: dexieSettingStore('rightPanelSize', 240),
|
||||
};
|
||||
@@ -115,7 +180,7 @@ export const settings = {
|
||||
// Wrap Dexie live queries in a Svelte store to avoid triggering the query for every subscriber
|
||||
function dexieStore<T>(querier: () => T | Promise<T>, initial?: T): Readable<T> {
|
||||
let store = writable<T>(initial);
|
||||
liveQuery(querier).subscribe(value => {
|
||||
liveQuery(querier).subscribe((value) => {
|
||||
if (value !== undefined) {
|
||||
store.set(value);
|
||||
}
|
||||
@@ -149,7 +214,7 @@ export class GPXStatisticsTree {
|
||||
let statistics = new GPXStatistics();
|
||||
let id = item.getIdAtLevel(this.level);
|
||||
if (id === undefined || id === 'waypoints') {
|
||||
Object.keys(this.statistics).forEach(key => {
|
||||
Object.keys(this.statistics).forEach((key) => {
|
||||
if (this.statistics[key] instanceof GPXStatistics) {
|
||||
statistics.mergeWith(this.statistics[key]);
|
||||
} else {
|
||||
@@ -166,26 +231,30 @@ export class GPXStatisticsTree {
|
||||
}
|
||||
return statistics;
|
||||
}
|
||||
};
|
||||
export type GPXFileWithStatistics = { file: GPXFile, statistics: GPXStatisticsTree };
|
||||
}
|
||||
export type GPXFileWithStatistics = { file: GPXFile; statistics: GPXStatisticsTree };
|
||||
|
||||
// Wrap Dexie live queries in a Svelte store to avoid triggering the query for every subscriber, also takes care of the conversion to a GPXFile object
|
||||
function dexieGPXFileStore(id: string): Readable<GPXFileWithStatistics> & { destroy: () => void } {
|
||||
let store = writable<GPXFileWithStatistics>(undefined);
|
||||
let query = liveQuery(() => db.files.get(id)).subscribe(value => {
|
||||
let query = liveQuery(() => db.files.get(id)).subscribe((value) => {
|
||||
if (value !== undefined) {
|
||||
let gpx = new GPXFile(value);
|
||||
updateAnchorPoints(gpx);
|
||||
|
||||
let statistics = new GPXStatisticsTree(gpx);
|
||||
if (!fileState.has(id)) { // Update the map bounds for new files
|
||||
updateTargetMapBounds(id, statistics.getStatisticsFor(new ListFileItem(id)).global.bounds);
|
||||
if (!fileState.has(id)) {
|
||||
// Update the map bounds for new files
|
||||
updateTargetMapBounds(
|
||||
id,
|
||||
statistics.getStatisticsFor(new ListFileItem(id)).global.bounds
|
||||
);
|
||||
}
|
||||
|
||||
fileState.set(id, gpx);
|
||||
store.set({
|
||||
file: gpx,
|
||||
statistics
|
||||
statistics,
|
||||
});
|
||||
|
||||
if (get(selection).hasAnyChildren(new ListFileItem(id))) {
|
||||
@@ -198,7 +267,7 @@ function dexieGPXFileStore(id: string): Readable<GPXFileWithStatistics> & { dest
|
||||
destroy: () => {
|
||||
fileState.delete(id);
|
||||
query.unsubscribe();
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -210,22 +279,30 @@ function updateSelection(updatedFiles: GPXFile[], deletedFileIds: string[]) {
|
||||
if (file) {
|
||||
items.forEach((item) => {
|
||||
if (item instanceof ListTrackItem) {
|
||||
let newTrackIndex = file.trk.findIndex((track) => track._data.trackIndex === item.getTrackIndex());
|
||||
let newTrackIndex = file.trk.findIndex(
|
||||
(track) => track._data.trackIndex === item.getTrackIndex()
|
||||
);
|
||||
if (newTrackIndex === -1) {
|
||||
removedItems.push(item);
|
||||
}
|
||||
} else if (item instanceof ListTrackSegmentItem) {
|
||||
let newTrackIndex = file.trk.findIndex((track) => track._data.trackIndex === item.getTrackIndex());
|
||||
let newTrackIndex = file.trk.findIndex(
|
||||
(track) => track._data.trackIndex === item.getTrackIndex()
|
||||
);
|
||||
if (newTrackIndex === -1) {
|
||||
removedItems.push(item);
|
||||
} else {
|
||||
let newSegmentIndex = file.trk[newTrackIndex].trkseg.findIndex((segment) => segment._data.segmentIndex === item.getSegmentIndex());
|
||||
let newSegmentIndex = file.trk[newTrackIndex].trkseg.findIndex(
|
||||
(segment) => segment._data.segmentIndex === item.getSegmentIndex()
|
||||
);
|
||||
if (newSegmentIndex === -1) {
|
||||
removedItems.push(item);
|
||||
}
|
||||
}
|
||||
} else if (item instanceof ListWaypointItem) {
|
||||
let newWaypointIndex = file.wpt.findIndex((wpt) => wpt._data.index === item.getWaypointIndex());
|
||||
let newWaypointIndex = file.wpt.findIndex(
|
||||
(wpt) => wpt._data.index === item.getWaypointIndex()
|
||||
);
|
||||
if (newWaypointIndex === -1) {
|
||||
removedItems.push(item);
|
||||
}
|
||||
@@ -255,9 +332,10 @@ function updateSelection(updatedFiles: GPXFile[], deletedFileIds: string[]) {
|
||||
// Commit the changes to the file state to the database
|
||||
function commitFileStateChange(newFileState: ReadonlyMap<string, GPXFile>, patch: Patch[]) {
|
||||
let changedFileIds = getChangedFileIds(patch);
|
||||
let updatedFileIds: string[] = [], deletedFileIds: string[] = [];
|
||||
let updatedFileIds: string[] = [],
|
||||
deletedFileIds: string[] = [];
|
||||
|
||||
changedFileIds.forEach(id => {
|
||||
changedFileIds.forEach((id) => {
|
||||
if (newFileState.has(id)) {
|
||||
updatedFileIds.push(id);
|
||||
} else {
|
||||
@@ -265,8 +343,10 @@ function commitFileStateChange(newFileState: ReadonlyMap<string, GPXFile>, patch
|
||||
}
|
||||
});
|
||||
|
||||
let updatedFiles = updatedFileIds.map(id => newFileState.get(id)).filter(file => file !== undefined) as GPXFile[];
|
||||
updatedFileIds = updatedFiles.map(file => file._data.id);
|
||||
let updatedFiles = updatedFileIds
|
||||
.map((id) => newFileState.get(id))
|
||||
.filter((file) => file !== undefined) as GPXFile[];
|
||||
updatedFileIds = updatedFiles.map((file) => file._data.id);
|
||||
|
||||
updateSelection(updatedFiles, deletedFileIds);
|
||||
|
||||
@@ -282,13 +362,15 @@ function commitFileStateChange(newFileState: ReadonlyMap<string, GPXFile>, patch
|
||||
});
|
||||
}
|
||||
|
||||
export const fileObservers: Writable<Map<string, Readable<GPXFileWithStatistics | undefined> & { destroy?: () => void }>> = writable(new Map());
|
||||
export const fileObservers: Writable<
|
||||
Map<string, Readable<GPXFileWithStatistics | undefined> & { destroy?: () => void }>
|
||||
> = writable(new Map());
|
||||
const fileState: Map<string, GPXFile> = new Map(); // Used to generate patches
|
||||
|
||||
// Observe the file ids in the database, and maintain a map of file observers for the corresponding files
|
||||
export function observeFilesFromDatabase(fitBounds: boolean) {
|
||||
let initialize = true;
|
||||
liveQuery(() => db.fileids.toArray()).subscribe(dbFileIds => {
|
||||
liveQuery(() => db.fileids.toArray()).subscribe((dbFileIds) => {
|
||||
if (initialize) {
|
||||
if (fitBounds && dbFileIds.length > 0) {
|
||||
initTargetMapBounds(dbFileIds);
|
||||
@@ -296,17 +378,21 @@ export function observeFilesFromDatabase(fitBounds: boolean) {
|
||||
initialize = false;
|
||||
}
|
||||
// Find new files to observe
|
||||
let newFiles = dbFileIds.filter(id => !get(fileObservers).has(id)).sort((a, b) => parseInt(a.split('-')[1]) - parseInt(b.split('-')[1]));
|
||||
let newFiles = dbFileIds
|
||||
.filter((id) => !get(fileObservers).has(id))
|
||||
.sort((a, b) => parseInt(a.split('-')[1]) - parseInt(b.split('-')[1]));
|
||||
// Find deleted files to stop observing
|
||||
let deletedFiles = Array.from(get(fileObservers).keys()).filter(id => !dbFileIds.find(fileId => fileId === id));
|
||||
let deletedFiles = Array.from(get(fileObservers).keys()).filter(
|
||||
(id) => !dbFileIds.find((fileId) => fileId === id)
|
||||
);
|
||||
|
||||
// Update the store
|
||||
if (newFiles.length > 0 || deletedFiles.length > 0) {
|
||||
fileObservers.update($files => {
|
||||
newFiles.forEach(id => {
|
||||
fileObservers.update(($files) => {
|
||||
newFiles.forEach((id) => {
|
||||
$files.set(id, dexieGPXFileStore(id));
|
||||
});
|
||||
deletedFiles.forEach(id => {
|
||||
deletedFiles.forEach((id) => {
|
||||
$files.get(id)?.destroy?.();
|
||||
$files.delete(id);
|
||||
});
|
||||
@@ -341,15 +427,28 @@ export function getStatistics(fileId: string): GPXStatisticsTree | undefined {
|
||||
}
|
||||
|
||||
const patchIndex: Readable<number> = dexieStore(() => db.settings.get('patchIndex'), -1);
|
||||
const patchMinMaxIndex: Readable<{ min: number, max: number }> = dexieStore(() => db.patches.orderBy(':id').keys().then(keys => {
|
||||
if (keys.length === 0) {
|
||||
return { min: 0, max: 0 };
|
||||
} else {
|
||||
return { min: keys[0], max: keys[keys.length - 1] + 1 };
|
||||
}
|
||||
}), { min: 0, max: 0 });
|
||||
export const canUndo: Readable<boolean> = derived([patchIndex, patchMinMaxIndex], ([$patchIndex, $patchMinMaxIndex]) => $patchIndex >= $patchMinMaxIndex.min);
|
||||
export const canRedo: Readable<boolean> = derived([patchIndex, patchMinMaxIndex], ([$patchIndex, $patchMinMaxIndex]) => $patchIndex < $patchMinMaxIndex.max - 1);
|
||||
const patchMinMaxIndex: Readable<{ min: number; max: number }> = dexieStore(
|
||||
() =>
|
||||
db.patches
|
||||
.orderBy(':id')
|
||||
.keys()
|
||||
.then((keys) => {
|
||||
if (keys.length === 0) {
|
||||
return { min: 0, max: 0 };
|
||||
} else {
|
||||
return { min: keys[0], max: keys[keys.length - 1] + 1 };
|
||||
}
|
||||
}),
|
||||
{ min: 0, max: 0 }
|
||||
);
|
||||
export const canUndo: Readable<boolean> = derived(
|
||||
[patchIndex, patchMinMaxIndex],
|
||||
([$patchIndex, $patchMinMaxIndex]) => $patchIndex >= $patchMinMaxIndex.min
|
||||
);
|
||||
export const canRedo: Readable<boolean> = derived(
|
||||
[patchIndex, patchMinMaxIndex],
|
||||
([$patchIndex, $patchMinMaxIndex]) => $patchIndex < $patchMinMaxIndex.max - 1
|
||||
);
|
||||
|
||||
// Helper function to apply a callback to the global file state
|
||||
function applyGlobal(callback: (files: Map<string, GPXFile>) => void) {
|
||||
@@ -377,7 +476,12 @@ function applyToFiles(fileIds: string[], callback: (file: WritableDraft<GPXFile>
|
||||
}
|
||||
|
||||
// Helper function to apply different callbacks to multiple files
|
||||
function applyEachToFilesAndGlobal(fileIds: string[], callbacks: ((file: WritableDraft<GPXFile>, context?: any) => void)[], globalCallback: (files: Map<string, GPXFile>, context?: any) => void, context?: any) {
|
||||
function applyEachToFilesAndGlobal(
|
||||
fileIds: string[],
|
||||
callbacks: ((file: WritableDraft<GPXFile>, context?: any) => void)[],
|
||||
globalCallback: (files: Map<string, GPXFile>, context?: any) => void,
|
||||
context?: any
|
||||
) {
|
||||
const [newFileState, patch, inversePatch] = produceWithPatches(fileState, (draft) => {
|
||||
fileIds.forEach((fileId, index) => {
|
||||
let file = draft.get(fileId);
|
||||
@@ -400,16 +504,22 @@ async function storePatches(patch: Patch[], inversePatch: Patch[]) {
|
||||
db.patches.where(':id').above(get(patchIndex)).delete(); // Delete all patches after the current patch to avoid redoing them
|
||||
let minmax = get(patchMinMaxIndex);
|
||||
if (minmax.max - minmax.min + 1 > MAX_PATCHES) {
|
||||
db.patches.where(':id').belowOrEqual(get(patchMinMaxIndex).max - MAX_PATCHES).delete();
|
||||
db.patches
|
||||
.where(':id')
|
||||
.belowOrEqual(get(patchMinMaxIndex).max - MAX_PATCHES)
|
||||
.delete();
|
||||
}
|
||||
}
|
||||
db.transaction('rw', db.patches, db.settings, async () => {
|
||||
let index = get(patchIndex) + 1;
|
||||
await db.patches.put({
|
||||
patch,
|
||||
inversePatch,
|
||||
await db.patches.put(
|
||||
{
|
||||
patch,
|
||||
inversePatch,
|
||||
index,
|
||||
},
|
||||
index
|
||||
}, index);
|
||||
);
|
||||
await db.settings.put(index, 'patchIndex');
|
||||
});
|
||||
}
|
||||
@@ -467,7 +577,12 @@ export const dbUtils = {
|
||||
applyToFiles: (ids: string[], callback: (file: WritableDraft<GPXFile>) => void) => {
|
||||
applyToFiles(ids, callback);
|
||||
},
|
||||
applyEachToFilesAndGlobal: (ids: string[], callbacks: ((file: WritableDraft<GPXFile>, context?: any) => void)[], globalCallback: (files: Map<string, GPXFile>, context?: any) => void, context?: any) => {
|
||||
applyEachToFilesAndGlobal: (
|
||||
ids: string[],
|
||||
callbacks: ((file: WritableDraft<GPXFile>, context?: any) => void)[],
|
||||
globalCallback: (files: Map<string, GPXFile>, context?: any) => void,
|
||||
context?: any
|
||||
) => {
|
||||
applyEachToFilesAndGlobal(ids, callbacks, globalCallback, context);
|
||||
},
|
||||
duplicateSelection: () => {
|
||||
@@ -491,20 +606,33 @@ export const dbUtils = {
|
||||
if (level === ListLevel.TRACK) {
|
||||
for (let item of items) {
|
||||
let trackIndex = (item as ListTrackItem).getTrackIndex();
|
||||
file.replaceTracks(trackIndex + 1, trackIndex, [file.trk[trackIndex].clone()]);
|
||||
file.replaceTracks(trackIndex + 1, trackIndex, [
|
||||
file.trk[trackIndex].clone(),
|
||||
]);
|
||||
}
|
||||
} else if (level === ListLevel.SEGMENT) {
|
||||
for (let item of items) {
|
||||
let trackIndex = (item as ListTrackSegmentItem).getTrackIndex();
|
||||
let segmentIndex = (item as ListTrackSegmentItem).getSegmentIndex();
|
||||
file.replaceTrackSegments(trackIndex, segmentIndex + 1, segmentIndex, [file.trk[trackIndex].trkseg[segmentIndex].clone()]);
|
||||
file.replaceTrackSegments(
|
||||
trackIndex,
|
||||
segmentIndex + 1,
|
||||
segmentIndex,
|
||||
[file.trk[trackIndex].trkseg[segmentIndex].clone()]
|
||||
);
|
||||
}
|
||||
} else if (level === ListLevel.WAYPOINTS) {
|
||||
file.replaceWaypoints(file.wpt.length, file.wpt.length - 1, file.wpt.map((wpt) => wpt.clone()));
|
||||
file.replaceWaypoints(
|
||||
file.wpt.length,
|
||||
file.wpt.length - 1,
|
||||
file.wpt.map((wpt) => wpt.clone())
|
||||
);
|
||||
} else if (level === ListLevel.WAYPOINT) {
|
||||
for (let item of items) {
|
||||
let waypointIndex = (item as ListWaypointItem).getWaypointIndex();
|
||||
file.replaceWaypoints(waypointIndex + 1, waypointIndex, [file.wpt[waypointIndex].clone()]);
|
||||
file.replaceWaypoints(waypointIndex + 1, waypointIndex, [
|
||||
file.wpt[waypointIndex].clone(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -513,16 +641,23 @@ export const dbUtils = {
|
||||
});
|
||||
},
|
||||
addNewTrack: (fileId: string) => {
|
||||
dbUtils.applyToFile(fileId, (file) => file.replaceTracks(file.trk.length, file.trk.length, [new Track()]));
|
||||
dbUtils.applyToFile(fileId, (file) =>
|
||||
file.replaceTracks(file.trk.length, file.trk.length, [new Track()])
|
||||
);
|
||||
},
|
||||
addNewSegment: (fileId: string, trackIndex: number) => {
|
||||
dbUtils.applyToFile(fileId, (file) => {
|
||||
let track = file.trk[trackIndex];
|
||||
track.replaceTrackSegments(track.trkseg.length, track.trkseg.length, [new TrackSegment()]);
|
||||
track.replaceTrackSegments(track.trkseg.length, track.trkseg.length, [
|
||||
new TrackSegment(),
|
||||
]);
|
||||
});
|
||||
},
|
||||
reverseSelection: () => {
|
||||
if (!get(selection).hasAnyChildren(new ListRootItem(), true, ['waypoints']) || get(gpxStatistics).local.points?.length <= 1) {
|
||||
if (
|
||||
!get(selection).hasAnyChildren(new ListRootItem(), true, ['waypoints']) ||
|
||||
get(gpxStatistics).local.points?.length <= 1
|
||||
) {
|
||||
return;
|
||||
}
|
||||
applyGlobal((draft) => {
|
||||
@@ -579,13 +714,13 @@ export const dbUtils = {
|
||||
let target: ListItem = new ListRootItem();
|
||||
let targetFile: GPXFile | undefined = undefined;
|
||||
let toMerge: {
|
||||
trk: Track[],
|
||||
trkseg: TrackSegment[],
|
||||
wpt: Waypoint[]
|
||||
trk: Track[];
|
||||
trkseg: TrackSegment[];
|
||||
wpt: Waypoint[];
|
||||
} = {
|
||||
trk: [],
|
||||
trkseg: [],
|
||||
wpt: []
|
||||
wpt: [],
|
||||
};
|
||||
applyToOrderedSelectedItemsFromFile((fileId, level, items) => {
|
||||
let file = draft.get(fileId);
|
||||
@@ -608,8 +743,15 @@ export const dbUtils = {
|
||||
if (level === ListLevel.TRACK) {
|
||||
items.forEach((item, index) => {
|
||||
let trackIndex = (item as ListTrackItem).getTrackIndex();
|
||||
toMerge.trkseg.splice(0, 0, ...originalFile.trk[trackIndex].trkseg.map((segment) => segment.clone()));
|
||||
if (index === items.length - 1) { // Order is reversed, so the last track is the first one and the one to keep
|
||||
toMerge.trkseg.splice(
|
||||
0,
|
||||
0,
|
||||
...originalFile.trk[trackIndex].trkseg.map((segment) =>
|
||||
segment.clone()
|
||||
)
|
||||
);
|
||||
if (index === items.length - 1) {
|
||||
// Order is reversed, so the last track is the first one and the one to keep
|
||||
target = item;
|
||||
file.trk[trackIndex].trkseg = [];
|
||||
} else {
|
||||
@@ -620,10 +762,15 @@ export const dbUtils = {
|
||||
items.forEach((item, index) => {
|
||||
let trackIndex = (item as ListTrackSegmentItem).getTrackIndex();
|
||||
let segmentIndex = (item as ListTrackSegmentItem).getSegmentIndex();
|
||||
if (index === items.length - 1) { // Order is reversed, so the last segment is the first one and the one to keep
|
||||
if (index === items.length - 1) {
|
||||
// Order is reversed, so the last segment is the first one and the one to keep
|
||||
target = item;
|
||||
}
|
||||
toMerge.trkseg.splice(0, 0, originalFile.trk[trackIndex].trkseg[segmentIndex].clone());
|
||||
toMerge.trkseg.splice(
|
||||
0,
|
||||
0,
|
||||
originalFile.trk[trackIndex].trkseg[segmentIndex].clone()
|
||||
);
|
||||
file.trk[trackIndex].trkseg.splice(segmentIndex, 1);
|
||||
});
|
||||
}
|
||||
@@ -635,15 +782,24 @@ export const dbUtils = {
|
||||
|
||||
if (mergeTraces) {
|
||||
let statistics = get(gpxStatistics);
|
||||
let speed = statistics.global.speed.moving > 0 ? statistics.global.speed.moving : undefined;
|
||||
let speed =
|
||||
statistics.global.speed.moving > 0 ? statistics.global.speed.moving : undefined;
|
||||
let startTime: Date | undefined = undefined;
|
||||
if (speed !== undefined) {
|
||||
if (statistics.local.points.length > 0 && statistics.local.points[0].time !== undefined) {
|
||||
if (
|
||||
statistics.local.points.length > 0 &&
|
||||
statistics.local.points[0].time !== undefined
|
||||
) {
|
||||
startTime = statistics.local.points[0].time;
|
||||
} else {
|
||||
let index = statistics.local.points.findIndex((point) => point.time !== undefined);
|
||||
let index = statistics.local.points.findIndex(
|
||||
(point) => point.time !== undefined
|
||||
);
|
||||
if (index !== -1) {
|
||||
startTime = new Date(statistics.local.points[index].time.getTime() - 1000 * 3600 * statistics.local.distance.total[index] / speed);
|
||||
startTime = new Date(
|
||||
statistics.local.points[index].time.getTime() -
|
||||
(1000 * 3600 * statistics.local.distance.total[index]) / speed
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -652,7 +808,14 @@ export const dbUtils = {
|
||||
let s = new TrackSegment();
|
||||
toMerge.trk.map((track) => {
|
||||
track.trkseg.forEach((segment) => {
|
||||
s.replaceTrackPoints(s.trkpt.length, s.trkpt.length, segment.trkpt.slice(), speed, startTime, removeGaps);
|
||||
s.replaceTrackPoints(
|
||||
s.trkpt.length,
|
||||
s.trkpt.length,
|
||||
segment.trkpt.slice(),
|
||||
speed,
|
||||
startTime,
|
||||
removeGaps
|
||||
);
|
||||
});
|
||||
});
|
||||
toMerge.trk = [toMerge.trk[0]];
|
||||
@@ -661,7 +824,14 @@ export const dbUtils = {
|
||||
if (toMerge.trkseg.length > 0) {
|
||||
let s = new TrackSegment();
|
||||
toMerge.trkseg.forEach((segment) => {
|
||||
s.replaceTrackPoints(s.trkpt.length, s.trkpt.length, segment.trkpt.slice(), speed, startTime, removeGaps);
|
||||
s.replaceTrackPoints(
|
||||
s.trkpt.length,
|
||||
s.trkpt.length,
|
||||
segment.trkpt.slice(),
|
||||
speed,
|
||||
startTime,
|
||||
removeGaps
|
||||
);
|
||||
});
|
||||
toMerge.trkseg = [s];
|
||||
}
|
||||
@@ -677,7 +847,12 @@ export const dbUtils = {
|
||||
} else if (target instanceof ListTrackSegmentItem) {
|
||||
let trackIndex = target.getTrackIndex();
|
||||
let segmentIndex = target.getSegmentIndex();
|
||||
targetFile.replaceTrackSegments(trackIndex, segmentIndex, segmentIndex - 1, toMerge.trkseg);
|
||||
targetFile.replaceTrackSegments(
|
||||
trackIndex,
|
||||
segmentIndex,
|
||||
segmentIndex - 1,
|
||||
toMerge.trkseg
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -700,11 +875,15 @@ export const dbUtils = {
|
||||
start -= length;
|
||||
end -= length;
|
||||
} else if (level === ListLevel.TRACK) {
|
||||
let trackIndices = items.map((item) => (item as ListTrackItem).getTrackIndex());
|
||||
let trackIndices = items.map((item) =>
|
||||
(item as ListTrackItem).getTrackIndex()
|
||||
);
|
||||
file.crop(start, end, trackIndices);
|
||||
} else if (level === ListLevel.SEGMENT) {
|
||||
let trackIndices = [(items[0] as ListTrackSegmentItem).getTrackIndex()];
|
||||
let segmentIndices = items.map((item) => (item as ListTrackSegmentItem).getSegmentIndex());
|
||||
let segmentIndices = items.map((item) =>
|
||||
(item as ListTrackSegmentItem).getSegmentIndex()
|
||||
);
|
||||
file.crop(start, end, trackIndices, segmentIndices);
|
||||
}
|
||||
}
|
||||
@@ -724,14 +903,17 @@ export const dbUtils = {
|
||||
return {
|
||||
wptIndex: wptIndex,
|
||||
index: [0],
|
||||
distance: Number.MAX_VALUE
|
||||
distance: Number.MAX_VALUE,
|
||||
};
|
||||
})
|
||||
});
|
||||
file.trk.forEach((track, index) => {
|
||||
track.getSegments().forEach((segment) => {
|
||||
segment.trkpt.forEach((point) => {
|
||||
file.wpt.forEach((wpt, wptIndex) => {
|
||||
let dist = distance(point.getCoordinates(), wpt.getCoordinates());
|
||||
let dist = distance(
|
||||
point.getCoordinates(),
|
||||
wpt.getCoordinates()
|
||||
);
|
||||
if (dist < closest[wptIndex].distance) {
|
||||
closest[wptIndex].distance = dist;
|
||||
closest[wptIndex].index = [index];
|
||||
@@ -739,7 +921,7 @@ export const dbUtils = {
|
||||
closest[wptIndex].index.push(index);
|
||||
}
|
||||
});
|
||||
})
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -754,9 +936,16 @@ export const dbUtils = {
|
||||
return t;
|
||||
});
|
||||
newFile.replaceTracks(0, file.trk.length - 1, tracks);
|
||||
newFile.replaceWaypoints(0, file.wpt.length - 1, closest.filter((c) => c.index.includes(index)).map((c) => file.wpt[c.wptIndex]));
|
||||
newFile.replaceWaypoints(
|
||||
0,
|
||||
file.wpt.length - 1,
|
||||
closest
|
||||
.filter((c) => c.index.includes(index))
|
||||
.map((c) => file.wpt[c.wptIndex])
|
||||
);
|
||||
newFile._data.id = fileIds[index];
|
||||
newFile.metadata.name = track.name ?? `${file.metadata.name} (${index + 1})`;
|
||||
newFile.metadata.name =
|
||||
track.name ?? `${file.metadata.name} (${index + 1})`;
|
||||
draft.set(newFile._data.id, freeze(newFile));
|
||||
});
|
||||
} else if (file.trk.length === 1) {
|
||||
@@ -766,13 +955,16 @@ export const dbUtils = {
|
||||
return {
|
||||
wptIndex: wptIndex,
|
||||
index: [0],
|
||||
distance: Number.MAX_VALUE
|
||||
distance: Number.MAX_VALUE,
|
||||
};
|
||||
})
|
||||
});
|
||||
file.trk[0].trkseg.forEach((segment, index) => {
|
||||
segment.trkpt.forEach((point) => {
|
||||
file.wpt.forEach((wpt, wptIndex) => {
|
||||
let dist = distance(point.getCoordinates(), wpt.getCoordinates());
|
||||
let dist = distance(
|
||||
point.getCoordinates(),
|
||||
wpt.getCoordinates()
|
||||
);
|
||||
if (dist < closest[wptIndex].distance) {
|
||||
closest[wptIndex].distance = dist;
|
||||
closest[wptIndex].index = [index];
|
||||
@@ -785,8 +977,16 @@ export const dbUtils = {
|
||||
|
||||
file.trk[0].trkseg.forEach((segment, index) => {
|
||||
let newFile = file.clone();
|
||||
newFile.replaceTrackSegments(0, 0, file.trk[0].trkseg.length - 1, [segment]);
|
||||
newFile.replaceWaypoints(0, file.wpt.length - 1, closest.filter((c) => c.index.includes(index)).map((c) => file.wpt[c.wptIndex]));
|
||||
newFile.replaceTrackSegments(0, 0, file.trk[0].trkseg.length - 1, [
|
||||
segment,
|
||||
]);
|
||||
newFile.replaceWaypoints(
|
||||
0,
|
||||
file.wpt.length - 1,
|
||||
closest
|
||||
.filter((c) => c.index.includes(index))
|
||||
.map((c) => file.wpt[c.wptIndex])
|
||||
);
|
||||
newFile._data.id = fileIds[index];
|
||||
newFile.metadata.name = `${file.trk[0].name ?? file.metadata.name} (${index + 1})`;
|
||||
draft.set(newFile._data.id, freeze(newFile));
|
||||
@@ -815,7 +1015,13 @@ export const dbUtils = {
|
||||
});
|
||||
});
|
||||
},
|
||||
split(fileId: string, trackIndex: number, segmentIndex: number, coordinates: Coordinates, trkptIndex?: number) {
|
||||
split(
|
||||
fileId: string,
|
||||
trackIndex: number,
|
||||
segmentIndex: number,
|
||||
coordinates: Coordinates,
|
||||
trkptIndex?: number
|
||||
) {
|
||||
let splitType = get(splitAs);
|
||||
return applyGlobal((draft) => {
|
||||
let file = getFile(fileId);
|
||||
@@ -833,7 +1039,10 @@ export const dbUtils = {
|
||||
|
||||
let absoluteIndex = minIndex;
|
||||
file.forEachSegment((seg, trkIndex, segIndex) => {
|
||||
if ((trkIndex < trackIndex && splitType === SplitType.FILES) || (trkIndex === trackIndex && segIndex < segmentIndex)) {
|
||||
if (
|
||||
(trkIndex < trackIndex && splitType === SplitType.FILES) ||
|
||||
(trkIndex === trackIndex && segIndex < segmentIndex)
|
||||
) {
|
||||
absoluteIndex += seg.trkpt.length;
|
||||
}
|
||||
});
|
||||
@@ -863,13 +1072,21 @@ export const dbUtils = {
|
||||
start.crop(0, minIndex);
|
||||
let end = segment.clone();
|
||||
end.crop(minIndex, segment.trkpt.length - 1);
|
||||
newFile.replaceTrackSegments(trackIndex, segmentIndex, segmentIndex, [start, end]);
|
||||
newFile.replaceTrackSegments(trackIndex, segmentIndex, segmentIndex, [
|
||||
start,
|
||||
end,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
cleanSelection: (bounds: [Coordinates, Coordinates], inside: boolean, deleteTrackPoints: boolean, deleteWaypoints: boolean) => {
|
||||
cleanSelection: (
|
||||
bounds: [Coordinates, Coordinates],
|
||||
inside: boolean,
|
||||
deleteTrackPoints: boolean,
|
||||
deleteWaypoints: boolean
|
||||
) => {
|
||||
if (get(selection).size === 0) {
|
||||
return;
|
||||
}
|
||||
@@ -880,16 +1097,35 @@ export const dbUtils = {
|
||||
if (level === ListLevel.FILE) {
|
||||
file.clean(bounds, inside, deleteTrackPoints, deleteWaypoints);
|
||||
} else if (level === ListLevel.TRACK) {
|
||||
let trackIndices = items.map((item) => (item as ListTrackItem).getTrackIndex());
|
||||
file.clean(bounds, inside, deleteTrackPoints, deleteWaypoints, trackIndices);
|
||||
let trackIndices = items.map((item) =>
|
||||
(item as ListTrackItem).getTrackIndex()
|
||||
);
|
||||
file.clean(
|
||||
bounds,
|
||||
inside,
|
||||
deleteTrackPoints,
|
||||
deleteWaypoints,
|
||||
trackIndices
|
||||
);
|
||||
} else if (level === ListLevel.SEGMENT) {
|
||||
let trackIndices = [(items[0] as ListTrackSegmentItem).getTrackIndex()];
|
||||
let segmentIndices = items.map((item) => (item as ListTrackSegmentItem).getSegmentIndex());
|
||||
file.clean(bounds, inside, deleteTrackPoints, deleteWaypoints, trackIndices, segmentIndices);
|
||||
let segmentIndices = items.map((item) =>
|
||||
(item as ListTrackSegmentItem).getSegmentIndex()
|
||||
);
|
||||
file.clean(
|
||||
bounds,
|
||||
inside,
|
||||
deleteTrackPoints,
|
||||
deleteWaypoints,
|
||||
trackIndices,
|
||||
segmentIndices
|
||||
);
|
||||
} else if (level === ListLevel.WAYPOINTS) {
|
||||
file.clean(bounds, inside, false, deleteWaypoints);
|
||||
} else if (level === ListLevel.WAYPOINT) {
|
||||
let waypointIndices = items.map((item) => (item as ListWaypointItem).getWaypointIndex());
|
||||
let waypointIndices = items.map((item) =>
|
||||
(item as ListWaypointItem).getWaypointIndex()
|
||||
);
|
||||
file.clean(bounds, inside, false, deleteWaypoints, [], [], waypointIndices);
|
||||
}
|
||||
}
|
||||
@@ -911,7 +1147,15 @@ export const dbUtils = {
|
||||
let segmentIndex = item.getSegmentIndex();
|
||||
let points = itemsAndPoints.get(item);
|
||||
if (points) {
|
||||
file.replaceTrackPoints(trackIndex, segmentIndex, 0, file.trk[trackIndex].trkseg[segmentIndex].getNumberOfTrackPoints() - 1, points);
|
||||
file.replaceTrackPoints(
|
||||
trackIndex,
|
||||
segmentIndex,
|
||||
0,
|
||||
file.trk[trackIndex].trkseg[
|
||||
segmentIndex
|
||||
].getNumberOfTrackPoints() - 1,
|
||||
points
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -938,9 +1182,11 @@ export const dbUtils = {
|
||||
});
|
||||
} else {
|
||||
let fileIds = new Set<string>();
|
||||
get(selection).getSelected().forEach((item) => {
|
||||
fileIds.add(item.getFileId());
|
||||
});
|
||||
get(selection)
|
||||
.getSelected()
|
||||
.forEach((item) => {
|
||||
fileIds.add(item.getFileId());
|
||||
});
|
||||
let wpt = new Waypoint(waypoint);
|
||||
wpt.ele = elevation[0];
|
||||
dbUtils.applyToFiles(Array.from(fileIds), (file) =>
|
||||
@@ -984,16 +1230,22 @@ export const dbUtils = {
|
||||
if (level === ListLevel.FILE) {
|
||||
file.setHidden(hidden);
|
||||
} else if (level === ListLevel.TRACK) {
|
||||
let trackIndices = items.map((item) => (item as ListTrackItem).getTrackIndex());
|
||||
let trackIndices = items.map((item) =>
|
||||
(item as ListTrackItem).getTrackIndex()
|
||||
);
|
||||
file.setHidden(hidden, trackIndices);
|
||||
} else if (level === ListLevel.SEGMENT) {
|
||||
let trackIndices = [(items[0] as ListTrackSegmentItem).getTrackIndex()];
|
||||
let segmentIndices = items.map((item) => (item as ListTrackSegmentItem).getSegmentIndex());
|
||||
let segmentIndices = items.map((item) =>
|
||||
(item as ListTrackSegmentItem).getSegmentIndex()
|
||||
);
|
||||
file.setHidden(hidden, trackIndices, segmentIndices);
|
||||
} else if (level === ListLevel.WAYPOINTS) {
|
||||
file.setHiddenWaypoints(hidden);
|
||||
} else if (level === ListLevel.WAYPOINT) {
|
||||
let waypointIndices = items.map((item) => (item as ListWaypointItem).getWaypointIndex());
|
||||
let waypointIndices = items.map((item) =>
|
||||
(item as ListWaypointItem).getWaypointIndex()
|
||||
);
|
||||
file.setHiddenWaypoints(hidden, waypointIndices);
|
||||
}
|
||||
}
|
||||
@@ -1020,7 +1272,12 @@ export const dbUtils = {
|
||||
for (let item of items) {
|
||||
let trackIndex = (item as ListTrackSegmentItem).getTrackIndex();
|
||||
let segmentIndex = (item as ListTrackSegmentItem).getSegmentIndex();
|
||||
file.replaceTrackSegments(trackIndex, segmentIndex, segmentIndex, []);
|
||||
file.replaceTrackSegments(
|
||||
trackIndex,
|
||||
segmentIndex,
|
||||
segmentIndex,
|
||||
[]
|
||||
);
|
||||
}
|
||||
} else if (level === ListLevel.WAYPOINTS) {
|
||||
file.replaceWaypoints(0, file.wpt.length - 1, []);
|
||||
@@ -1053,14 +1310,18 @@ export const dbUtils = {
|
||||
});
|
||||
} else if (level === ListLevel.SEGMENT) {
|
||||
let trackIndex = (items[0] as ListTrackSegmentItem).getTrackIndex();
|
||||
let segmentIndices = items.map((item) => (item as ListTrackSegmentItem).getSegmentIndex());
|
||||
let segmentIndices = items.map((item) =>
|
||||
(item as ListTrackSegmentItem).getSegmentIndex()
|
||||
);
|
||||
segmentIndices.forEach((segmentIndex) => {
|
||||
points.push(...file.trk[trackIndex].trkseg[segmentIndex].getTrackPoints());
|
||||
});
|
||||
} else if (level === ListLevel.WAYPOINTS) {
|
||||
points.push(...file.wpt);
|
||||
} else if (level === ListLevel.WAYPOINT) {
|
||||
let waypointIndices = items.map((item) => (item as ListWaypointItem).getWaypointIndex());
|
||||
let waypointIndices = items.map((item) =>
|
||||
(item as ListWaypointItem).getWaypointIndex()
|
||||
);
|
||||
points.push(...waypointIndices.map((waypointIndex) => file.wpt[waypointIndex]));
|
||||
}
|
||||
}
|
||||
@@ -1078,16 +1339,22 @@ export const dbUtils = {
|
||||
if (level === ListLevel.FILE) {
|
||||
file.addElevation(elevations);
|
||||
} else if (level === ListLevel.TRACK) {
|
||||
let trackIndices = items.map((item) => (item as ListTrackItem).getTrackIndex());
|
||||
let trackIndices = items.map((item) =>
|
||||
(item as ListTrackItem).getTrackIndex()
|
||||
);
|
||||
file.addElevation(elevations, trackIndices, undefined, []);
|
||||
} else if (level === ListLevel.SEGMENT) {
|
||||
let trackIndices = [(items[0] as ListTrackSegmentItem).getTrackIndex()];
|
||||
let segmentIndices = items.map((item) => (item as ListTrackSegmentItem).getSegmentIndex());
|
||||
let segmentIndices = items.map((item) =>
|
||||
(item as ListTrackSegmentItem).getSegmentIndex()
|
||||
);
|
||||
file.addElevation(elevations, trackIndices, segmentIndices, []);
|
||||
} else if (level === ListLevel.WAYPOINTS) {
|
||||
file.addElevation(elevations, [], [], undefined);
|
||||
} else if (level === ListLevel.WAYPOINT) {
|
||||
let waypointIndices = items.map((item) => (item as ListWaypointItem).getWaypointIndex());
|
||||
let waypointIndices = items.map((item) =>
|
||||
(item as ListWaypointItem).getWaypointIndex()
|
||||
);
|
||||
file.addElevation(elevations, [], [], waypointIndices);
|
||||
}
|
||||
}
|
||||
@@ -1114,7 +1381,7 @@ export const dbUtils = {
|
||||
undo: () => {
|
||||
if (get(canUndo)) {
|
||||
let index = get(patchIndex);
|
||||
db.patches.get(index).then(patch => {
|
||||
db.patches.get(index).then((patch) => {
|
||||
if (patch) {
|
||||
applyPatch(patch.inversePatch);
|
||||
db.settings.put(index - 1, 'patchIndex');
|
||||
@@ -1125,12 +1392,12 @@ export const dbUtils = {
|
||||
redo: () => {
|
||||
if (get(canRedo)) {
|
||||
let index = get(patchIndex) + 1;
|
||||
db.patches.get(index).then(patch => {
|
||||
db.patches.get(index).then((patch) => {
|
||||
if (patch) {
|
||||
applyPatch(patch.patch);
|
||||
db.settings.put(index, 'patchIndex');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
Reference in New Issue
Block a user