Skip to content

Commit

Permalink
Deploying to gh-pages from @ 85f35d3 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
johnman committed Oct 17, 2023
1 parent d34d3e1 commit 0b78251
Show file tree
Hide file tree
Showing 3 changed files with 285 additions and 205 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { createOptionEntry, setElementVisibility } from './helper.js';

let rejectAppSelection;
let resolveAppSelection;
let launchBtn;
let cancelSelectionBtn;
let intentsContainer;
Expand Down Expand Up @@ -76,18 +74,8 @@ async function init() {
}
await setupIntentView(intents);

if (Array.isArray(apps)) {
for (const app of apps) {
appLookup[app.appId] = app;
}
await setupAppView(apps, intent.name);
}

cancelSelectionBtn.addEventListener('click', async () => {
if (rejectAppSelection !== undefined) {
rejectAppSelection('UserCancelledResolution');
}
fin.me.close(true);
await fin.me.dispatchPopupResult();
});

launchBtn.addEventListener('click', async () => {
Expand All @@ -97,9 +85,15 @@ async function init() {
}
const appId = appsContainer.value;

resolveAppSelection({ appId, instanceId, intent });
fin.me.close(true);
await fin.me.dispatchPopupResult({ appId, instanceId, intent });
});

if (Array.isArray(apps)) {
for (const app of apps) {
appLookup[app.appId] = app;
}
await setupAppView(apps, intent.name);
}
}

/**
Expand Down Expand Up @@ -287,12 +281,3 @@ function setupAppMetadata(appId) {
setElementVisibility(appSummaryContainer, false);
}
}

// this function is called by the interop broker.ts file in the src directory so that it waits to see whether the end user has made a selection or cancelled the intent request.
window['getIntentSelection'] = async () => {
launchBtn.disabled = false;
return new Promise((resolve, reject) => {
resolveAppSelection = resolve;
rejectAppSelection = reject;
});
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { createRadioEntry, getSelection, setElementVisibility } from './helper.js';

let rejectAppSelection;
let resolveAppSelection;
let backBtn;
let launchBtn;
let cancelAppSelectionBtn;
Expand Down Expand Up @@ -84,10 +82,7 @@ function setupIntentView(setupIntents) {
}

cancelIntentSelectionBtn.addEventListener('click', async () => {
if (rejectAppSelection !== undefined) {
rejectAppSelection('Application selection cancelled.');
}
fin.me.close(true);
await fin.me.dispatchPopupResult();
});

nextBtn.addEventListener('click', () => {
Expand Down Expand Up @@ -136,31 +131,18 @@ function setupAppView(applications) {
});

cancelAppSelectionBtn.addEventListener('click', async () => {
if (rejectAppSelection !== undefined) {
rejectAppSelection('UserCancelledResolution');
}
fin.me.close(true);
await fin.me.dispatchPopupResult();
});

launchBtn.addEventListener('click', async () => {
resolveAppSelection({ appId: getSelection(listName), intent });
fin.me.close(true);
await fin.me.dispatchPopupResult({ appId: getSelection(listName), intent });
});

setElementVisibility(intentSelectionContainer, false);
setElementVisibility(appSelectionContainer, true);
}
}

// this function is called by the interopbroker.ts file in the src directory so that it waits to see whether the end user has made a selection or cancelled the intent request.
window['getIntentSelection'] = async () => {
launchBtn.disabled = false;
return new Promise((resolve, reject) => {
resolveAppSelection = resolve;
rejectAppSelection = reject;
});
};

document.addEventListener('DOMContentLoaded', () => {
initializeDOM();
});
Loading

0 comments on commit 0b78251

Please sign in to comment.