Improve toolbox module loading and goal tree previews
All checks were successful
Deploy Sokko G / deploy (push) Successful in 15s
All checks were successful
Deploy Sokko G / deploy (push) Successful in 15s
This commit is contained in:
parent
abfa23fb3e
commit
50029b45a2
9 changed files with 259 additions and 177 deletions
|
|
@ -87,13 +87,17 @@ export function useToolboxActions({ store, notify, creationTemplate, setConfirmM
|
|||
const imageFiles = [...files].filter((file) => file?.type?.startsWith("image/"));
|
||||
if (!imageFiles.length) return false;
|
||||
const data = store.getModuleData(toolboxId, moduleId, { images: [] });
|
||||
const images = [];
|
||||
for (const file of imageFiles) {
|
||||
const image = { id: uid("image"), dataUrl: await compressImage(file) };
|
||||
const label = labelFromFileName(file.name);
|
||||
if (label) image.label = label;
|
||||
data.images.unshift(image);
|
||||
images.unshift(image);
|
||||
}
|
||||
return store.updateModuleData(toolboxId, moduleId, data);
|
||||
return store.updateModuleData(toolboxId, moduleId, {
|
||||
...data,
|
||||
images: [...images, ...(Array.isArray(data.images) ? data.images : [])]
|
||||
});
|
||||
}
|
||||
|
||||
function createChecklistFromList(gameId, list) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue