Skip to content

Commit 559fd86

Browse files
authored
Fix connecting to a websocket the second time returning "window.document is undefined"
window.document is setup the first time, then cleared after start() is called... we need to reset up the window.document each time start() is called
1 parent 6eac65e commit 559fd86

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export default {
2929
const hubConnectionFunc = signalRHubConnectionFunc(serverUrl, options);
3030
const originalStart = hubConnectionFunc.start;
3131
hubConnectionFunc.start = (...args) => {
32+
window.document = window.document || { readyState: 'complete' };
3233
window.document.createElement = () => {
3334
return {
3435
protocol,

0 commit comments

Comments
 (0)