Attempt at fixing reconnection.
This commit is contained in:
parent
c4872f1fc0
commit
e46f25ff62
3 changed files with 5 additions and 5 deletions
src/mami.js
|
@ -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;
|
||||
|
|
|
@ -49,7 +49,7 @@ const SockChatKeepAlive = function(ctx, sendPing, delay) {
|
|||
start: run,
|
||||
stop: () => {
|
||||
clear();
|
||||
ctx.pingPromise?.cancel();
|
||||
ctx.pingPromise?.reject();
|
||||
},
|
||||
};
|
||||
};
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue