From 9b55bdf0ea4e42da443ef9fde3d47646cbddd49a Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Mon, 22 Nov 2021 11:55:38 +0100 Subject: [PATCH] Reconnect events are triggered on the socket.io manager since v3 --- src/pdfdraw.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pdfdraw.js b/src/pdfdraw.js index 4dc2fea..e8b97f1 100644 --- a/src/pdfdraw.js +++ b/src/pdfdraw.js @@ -756,15 +756,15 @@ function Annotator(socketurl, id, userid, displayname, token) { }); // Also allow polling connections when the connection was interrupted once // (could be caused by proxy / firewall). - this.socket.on('reconnect_attempt', function() { + this.socket.io.on('reconnect_attempt', function() { this.socket.io.opts.transports = ['polling', 'websocket']; }.bind(this)); + this.socket.io.on('reconnect', this.onReconnected.bind(this)); this.socket.on('message', this.onMessage.bind(this)); this.socket.on('user.joined', this.onUserJoined.bind(this)); this.socket.on('user.left', this.onUserLeft.bind(this)); this.socket.on('connect', this.onConnected.bind(this)); this.socket.on('disconnect', this.onDisconnect.bind(this)); - this.socket.on('reconnect', this.onReconnected.bind(this)); this.colorPicker = new iro.ColorPicker("#colorPicker", { width: 320,