From 9fdca110700b60f7a8eb324f0723a6f9ed60c971 Mon Sep 17 00:00:00 2001 From: ProgrammerIn-wonderland <3838shah@gmail.com> Date: Tue, 20 May 2025 16:40:38 -0400 Subject: [PATCH] fix auth flow on subsequent loads --- src/puter-js/src/modules/networking/PSocket.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/puter-js/src/modules/networking/PSocket.js b/src/puter-js/src/modules/networking/PSocket.js index 3f23683c..73bfaa0b 100644 --- a/src/puter-js/src/modules/networking/PSocket.js +++ b/src/puter-js/src/modules/networking/PSocket.js @@ -36,13 +36,13 @@ export class PSocket extends EventListener { })).json()); wispInfo.handler = new PWispHandler(wispServer, wispToken); + // Wait for websocket to fully open + await new Promise((res, req) => { + wispInfo.handler.onReady = res; + }); } - // Wait for websocket to fully open - await new Promise((res, req) => { - wispInfo.handler.onReady = res; - }); const callbacks = { dataCallBack: (data) => {