mirror of
https://github.com/evennia/evennia.git
synced 2026-03-23 16:26:30 +01:00
Made sure the the websocket onclose is not called if websocket was never open (such as for clients only supporting ajax)
This commit is contained in:
parent
8141935a9b
commit
cd475a0a23
1 changed files with 4 additions and 2 deletions
|
|
@ -233,8 +233,10 @@ An "emitter" object must have a function
|
|||
};
|
||||
// Handle Websocket close event
|
||||
websocket.onclose = function (event) {
|
||||
// only emit if websocket was ever open at all
|
||||
Evennia.emit('connection_close', ["websocket"], event);
|
||||
if (ever_open) {
|
||||
// only emit if websocket was ever open at all
|
||||
Evennia.emit('connection_close', ["websocket"], event);
|
||||
}
|
||||
open = false;
|
||||
};
|
||||
// Handle websocket errors
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue