fix ready behavior

This commit is contained in:
CoolElectronics 2024-03-03 17:38:12 -05:00
parent a5b462f696
commit 1cc513560e
No known key found for this signature in database
GPG key ID: F63593D168636C50
7 changed files with 33 additions and 15 deletions

View file

@ -340,7 +340,7 @@ export class BareClient {
let switcher = findSwitcher();
if (!switcher.active) throw "there are no bare clients";
const client = switcher.active;
if (!client.ready) await client.init();
if (!client.ready) await (client as any).initpromise;
for (let i = 0; ; i++) {
if ('host' in headers) headers.host = urlO.host;