mirror of
https://github.com/gristlabs/grist-core.git
synced 2025-06-13 20:53:59 +00:00
fix WebSocket check that is no longer exactly the right thing
This commit is contained in:
parent
fef7a8f64e
commit
d2575a1ec3
@ -71,7 +71,12 @@ export class GristClientSocket {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _createWSSocket() {
|
private _createWSSocket() {
|
||||||
if (typeof WebSocket !== 'undefined') {
|
// We used to check if WebSocket was defined here, and use it
|
||||||
|
// if so, secure in the fact that we were in the browser and
|
||||||
|
// the browser would pass along cookie information. But recent
|
||||||
|
// node defines WebSocket, so we narrow down this path to when
|
||||||
|
// window is defined.
|
||||||
|
if (typeof window !== 'undefined') {
|
||||||
this._wsSocket = new WebSocket(this._url);
|
this._wsSocket = new WebSocket(this._url);
|
||||||
} else {
|
} else {
|
||||||
this._wsSocket = new WS(this._url, undefined, this._options);
|
this._wsSocket = new WS(this._url, undefined, this._options);
|
||||||
|
Loading…
Reference in New Issue
Block a user