From 26e04913babaeea64f60617b4c1c80d68dda2318 Mon Sep 17 00:00:00 2001 From: Garrett Michael Flynn Date: Wed, 29 May 2024 11:57:52 -0700 Subject: [PATCH] Update GuidedSourceData.js --- .../pages/guided-mode/data/GuidedSourceData.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/renderer/src/stories/pages/guided-mode/data/GuidedSourceData.js b/src/renderer/src/stories/pages/guided-mode/data/GuidedSourceData.js index 9643f6884..928dd0c75 100644 --- a/src/renderer/src/stories/pages/guided-mode/data/GuidedSourceData.js +++ b/src/renderer/src/stories/pages/guided-mode/data/GuidedSourceData.js @@ -247,6 +247,8 @@ export class GuidedSourceDataPage extends ManagedPage { const { subject, session } = getInfoFromId(id); + this.dismiss() + const header = document.createElement("div"); Object.assign(header.style, { paddingTop: "10px" }); const h2 = document.createElement("h3"); @@ -259,8 +261,6 @@ export class GuidedSourceDataPage extends ManagedPage { const modal = new Modal({ header }); - document.body.append(modal); - let alignment; modal.footer = new Button({ @@ -291,6 +291,12 @@ export class GuidedSourceDataPage extends ManagedPage { message: "Please wait...", }); + const { metadata } = data; + if (Object.keys(metadata).length === 0) { + this.notify(`

Time Alignment Failed

Please ensure that all source data is specified.`, "error"); + return false + } + alignment = new TimeAlignment({ data, interfaces: globalState.interfaces, @@ -299,10 +305,15 @@ export class GuidedSourceDataPage extends ManagedPage { modal.innerHTML = ""; modal.append(alignment); + + return true }, }); - modal.footer.onClick(); + const result = await modal.footer.onClick(); + if (!result) return; + + document.body.append(modal); modal.open = true; },