Skip to content

Commit

Permalink
Update GuidedSourceData.js
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettmflynn committed May 29, 2024
1 parent 6d83739 commit 26e0491
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -259,8 +261,6 @@ export class GuidedSourceDataPage extends ManagedPage {

const modal = new Modal({ header });

document.body.append(modal);

let alignment;

modal.footer = new Button({
Expand Down Expand Up @@ -291,6 +291,12 @@ export class GuidedSourceDataPage extends ManagedPage {
message: "Please wait...",
});

const { metadata } = data;
if (Object.keys(metadata).length === 0) {
this.notify(`<h4 style="margin: 0">Time Alignment Failed</h4><small>Please ensure that all source data is specified.</small>`, "error");
return false
}

alignment = new TimeAlignment({
data,
interfaces: globalState.interfaces,
Expand All @@ -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;
},
Expand Down

0 comments on commit 26e0491

Please sign in to comment.