Skip to content

Commit

Permalink
Implement lookup from PR 308 of zlux-app-server
Browse files Browse the repository at this point in the history
Signed-off-by: 1000TurquoisePogs <[email protected]>
  • Loading branch information
1000TurquoisePogs committed Aug 19, 2024
1 parent 2a9d01b commit 714fc04
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions base/src/plugin-manager/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,22 @@ class Plugin_2 extends Plugin_1 {
super(definition);
}

getWebEntrypoint():string|undefined {
let entryPoints = this.webContent?.entryPoints;
if (entryPoints) {
const searchParams = new URLSearchParams(window.location.search);
const useV2Desktop = searchParams.has("use-v2-desktop") && (searchParams.get("use-v2-desktop") == '1');
if (useV2Desktop || !entryPoints['3.0']) {
return 'main.js';
} else {
return ''+entryPoints['3.0'];
}
} else if (this.webContent) {
return 'main.js';
}
return undefined;
}

}


Expand Down
4 changes: 4 additions & 0 deletions interface/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,10 @@ declare namespace ZLUX {
getBasePlugin(): any;
}

interface PluginV2 extends Plugin {
getWebEntryPoint():string|undefined;
}

interface ContainerPluginDefinition {
getBasePlugin():Plugin;
}
Expand Down

0 comments on commit 714fc04

Please sign in to comment.