Attempt at fixing reconnection.

This commit is contained in:
flash 2025-05-25 11:58:53 +00:00
parent c4872f1fc0
commit e46f25ff62
Signed by: flash
GPG key ID: 2C9C2C574D47FE3E
3 changed files with 5 additions and 5 deletions
src/mami.js
proto/sockchat
sockchat

View file

@ -34,9 +34,9 @@ const SockChatContext = function(dispatch, sendPing, pingDelay) {
// what is this? C#?
public.dispose = () => {
public.keepAlive?.stop();
public.openPromise?.cancel();
public.authPromise?.cancel();
public.pingPromise?.cancel();
public.openPromise?.reject();
public.authPromise?.reject();
public.pingPromise?.reject();
};
return public;

View file

@ -49,7 +49,7 @@ const SockChatKeepAlive = function(ctx, sendPing, delay) {
start: run,
stop: () => {
clear();
ctx.pingPromise?.cancel();
ctx.pingPromise?.reject();
},
};
};

View file

@ -34,7 +34,7 @@ const MamiSockChat = function(eventTarget) {
try {
await client.open(url);
} catch(ex) {
return ex.wasKicked === true;
return ex?.wasKicked === true;
}
},
async authenticate(auth) {