diff --git a/src/renderer/src/stories/Table.js b/src/renderer/src/stories/Table.js index 3037eba08..9612ac6b6 100644 --- a/src/renderer/src/stories/Table.js +++ b/src/renderer/src/stories/Table.js @@ -432,9 +432,8 @@ export class Table extends LitElement { const initialCellsToUpdate = data.reduce((acc, v) => acc + v.length, 0); table.addHook("afterValidate", (isValid, value, row, prop) => { - const isUserUpdate = initialCellsToUpdate <= validated; - + if (isUserUpdate) { const header = typeof prop === "number" ? colHeaders[prop] : prop; let rowName = this.keyColumn ? rowHeaders[row] : row; diff --git a/src/renderer/src/stories/pages/guided-mode/options/utils.js b/src/renderer/src/stories/pages/guided-mode/options/utils.js index 7057f83e0..68781e8ab 100644 --- a/src/renderer/src/stories/pages/guided-mode/options/utils.js +++ b/src/renderer/src/stories/pages/guided-mode/options/utils.js @@ -24,9 +24,8 @@ export const openProgressSwal = (options, callback) => { export const run = async (url, payload, options = {}) => { const needsSwal = !options.swal && options.swal !== false; - - if (needsSwal) { + if (needsSwal) { if (!("showCancelButton" in options)) { options.showCancelButton = true; options.customClass = { actions: "swal-conversion-actions" }; @@ -36,37 +35,32 @@ export const run = async (url, payload, options = {}) => { options.fetch = { signal: cancelController.signal, - } + }; const popup = await openProgressSwal(options, (result) => { if (!result.isConfirmed) cancelController.abort(); }).then(async (swal) => { - if (options.onOpen) await options.onOpen(swal) - return swal + if (options.onOpen) await options.onOpen(swal); + return swal; }); const element = popup.getHtmlContainer(); - const actions = popup.getActions() - const loader = actions.querySelector(".swal2-loader") + const actions = popup.getActions(); + const loader = actions.querySelector(".swal2-loader"); const container = document.createElement("div"); - container.append(loader) + container.append(loader); element.innerText = ""; Object.assign(container.style, { - display: 'flex', - flexDirection: 'column', - alignItems: 'center', - justifyContent: 'center', - marginBottom: '25px' - }) + display: "flex", + flexDirection: "column", + alignItems: "center", + justifyContent: "center", + marginBottom: "25px", + }); element.appendChild(container); - element.insertAdjacentHTML( - "beforeend", - `
` - ); - - + element.insertAdjacentHTML("beforeend", `
`); } if (!("base" in options)) options.base = "/neuroconv"; @@ -79,8 +73,8 @@ export const run = async (url, payload, options = {}) => { headers: { "Content-Type": "application/json" }, body: JSON.stringify(payload), ...(options.fetch ?? {}), - }).then((res) => res.json()) - + }).then((res) => res.json()); + if (needsSwal) Swal.close(); if (results?.message) throw new Error(`Request to ${url} failed: ${results.message}`);