fix: improve WhatsApp settings and isolate IM host authentication
Some checks are pending
CI / Test, build, and verify package (push) Waiting to run

This commit is contained in:
oliver 2026-10-11 17:03:38 +08:00
parent bcbe85fdb1
commit bf73b0c0af
28 changed files with 848 additions and 116 deletions

View file

@ -0,0 +1,10 @@
/** Run same-process IM operations without inheriting a browser's UDS identity. */
export function runHarnessHostOperation(ctx, operation) {
// Cordis property access requires inject even for an optional service.
// ctx.get() supports dynamic lookup without making UDS a startup dependency.
const auth = typeof ctx?.get === 'function' ? ctx.get('udsAuth') : ctx?.udsAuth;
// Resolve on every call: auth can become ready or reload after IM starts.
return typeof auth?.runAsHost === 'function'
? auth.runAsHost(operation)
: operation();
}