fix: initWorkspace bug
This commit is contained in:
parent
0830b3abfa
commit
e81156d14f
|
|
@ -200,7 +200,7 @@ export const esbuildOptions = {
|
|||
`addon/chrome/content/scripts/${config.addonRef}.js`,
|
||||
),
|
||||
// Don't turn minify on
|
||||
minify: env.NODE_ENV === "production",
|
||||
minify: false,
|
||||
};
|
||||
|
||||
export async function main() {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import { waitUtilAsync } from "../../utils/wait";
|
||||
|
||||
export async function initWorkspace(container: XUL.Box, item: Zotero.Item) {
|
||||
if (!container) {
|
||||
return;
|
||||
|
|
@ -10,6 +12,8 @@ export async function initWorkspace(container: XUL.Box, item: Zotero.Item) {
|
|||
const customElements = container.ownerGlobal
|
||||
.customElements as CustomElementRegistry;
|
||||
|
||||
await waitUtilAsync(() => !!customElements.get("bn-workspace"));
|
||||
|
||||
const workspace = new (customElements.get("bn-workspace")!)() as any;
|
||||
container.append(workspace);
|
||||
workspace.item = item;
|
||||
|
|
|
|||
Loading…
Reference in New Issue