refactoring and tests

This commit is contained in:
vcoppe committed 2026-10-09 08:58:00 +02:00
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);
}
}