You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
virt/web/public/cloud/deploy.js

17 lines
591 B
JavaScript

const runtimeUrl = new URL('/cloud/runtime.js', location.origin);
const assetVersion = new URL(import.meta.url).searchParams.get('v');
if (assetVersion) runtimeUrl.searchParams.set('v', assetVersion);
const {
bindPageCleanup, buy, byId, initializeSession, openCreate,
showError,
} = await import(runtimeUrl.href);
export async function initialize() {
try {
if (!await initializeSession('create')) return;
bindPageCleanup();
byId('create-form')?.addEventListener('submit', buy);
await openCreate();
} catch (error) { showError('cloud-page-error', error.message); }
}