loleaflet/js/global.js | 2 +- loleaflet/src/core/Socket.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
New commits: commit 746a81c0f0df2969f6e9f43c199bb456e9328cf1 Author: Henry Castro <hcas...@collabora.com> AuthorDate: Tue Mar 12 14:56:11 2019 -0400 Commit: Henry Castro <hcas...@collabora.com> CommitDate: Tue Mar 12 14:58:19 2019 -0400 loleaflet: fix "failed: WebSocket is closed before... the connection is established" Change-Id: Icb44f1a9fe75ac995f9a771d0a0f052c55339df3 diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js index c6994ef84..b2e574bd1 100644 --- a/loleaflet/js/global.js +++ b/loleaflet/js/global.js @@ -90,8 +90,8 @@ var filePath = global.getParameterByName('file_path'); var wopiSrc = global.getParameterByName('WOPISrc'); if (wopiSrc != '') { - wopiSrc = '?WOPISrc=' + wopiSrc + '&compat=/ws'; global.docURL = decodeURIComponent(wopiSrc); + wopiSrc = '?WOPISrc=' + wopiSrc + '&compat=/ws'; if (global.accessToken !== '') { wopiParams = { 'access_token': global.accessToken, 'access_token_ttl': global.accessTokenTTL }; } diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index b48d33935..84fa0f304 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -82,7 +82,8 @@ L.Socket = L.Class.extend({ } // process messages for early socket connection - if (window.queueMsg && window.queueMsg.length > 0) { + if (socket && ((socket.readyState === 1 || socket.readyState === 0)) && + window.queueMsg && window.queueMsg.length > 0) { for (var it = 0; it < window.queueMsg.length; it++) { this._onMessage({data: window.queueMsg[it]}); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits