fix initWebsocket uncaught

This commit is contained in:
pa
2025-07-14 13:50:36 +09:00
committed by Natsumi
parent b6bc2cf202
commit c65cc29cd4
+12 -8
View File
@@ -26,14 +26,18 @@ export function initWebsocket() {
} }
return request('auth', { return request('auth', {
method: 'GET' method: 'GET'
}).then((json) => { })
const args = { .then((json) => {
json const args = {
}; json
if (args.json.ok) { };
connectWebSocket(args.json.token); if (args.json.ok) {
} connectWebSocket(args.json.token);
}); }
})
.catch((err) => {
console.error('WebSocket init error:', err);
});
} }
/** /**