Load the presenter client only on presenter entry

This commit is contained in:
Jonathan Sykes
2026-10-08 04:39:52 +08:00
parent 3c9a24ae45
commit 5fb9564468
7 changed files with 238 additions and 211 deletions

View File

@@ -111,7 +111,8 @@
proxy(name, methods, globalName) {
return Object.fromEntries(methods.map(method => [method, async (...args) => {
await load(name);
const target = root[globalName || name.split(':')[1]];
const key = globalName || name.split(':')[1];
const target = root.YT?.[key] || root[key];
if (typeof target?.[method] !== 'function') throw new Error('Missing lazy method: ' + method);
return target[method](...args);
}]));