mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-11-30 09:34:29 +00:00
refactoring and tests
This commit is contained in:
1 parent
3bb553d6b5
commit
da9abbae5e
45 files changed
+3558
-1564
No files matched your search
@@ -115,11 +115,15 @@ export function convertOldEmbeddingOptions(options: URLSearchParams): any {
|
||||
ids: [],
|
||||
};
|
||||
if (options.has('state')) {
|
||||
let state = JSON.parse(options.get('state')!);
|
||||
if (state.ids) {
|
||||
// the state comes from the url: it may be anything
|
||||
let state: any = {};
|
||||
try {
|
||||
state = JSON.parse(options.get('state')!) ?? {};
|
||||
} catch {}
|
||||
if (Array.isArray(state.ids)) {
|
||||
newOptions.ids.push(...state.ids);
|
||||
}
|
||||
if (state.urls) {
|
||||
if (Array.isArray(state.urls)) {
|
||||
newOptions.files.push(...state.urls);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user