apiConstructor

This commit is contained in:
Niels Lyngsø
2024-03-04 01:05:58 +01:00
parent f3ea204c9a
commit 7c406d4866

View File

@@ -42,7 +42,7 @@ export async function createExtensionElementWithApi<
);
}
} else {
await apiPromise;
apiConstructor = await apiPromise;
}
if (manifest.elementName) {
@@ -53,6 +53,7 @@ export async function createExtensionElementWithApi<
element = document.createElement(fallbackElement) as ElementType;
}
console.log('element', element, 'apiConstructor', apiConstructor);
if (element && apiConstructor) {
// If constructorArgs is a function, call it with the manifest to get the arguments:
const additionalArgs = (typeof constructorArgs === 'function' ? constructorArgs(manifest) : constructorArgs) ?? [];