@jupyter/docprovider 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ydrive.js +4 -3
- package/package.json +1 -1
package/lib/ydrive.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// Copyright (c) Jupyter Development Team.
|
|
2
2
|
// Distributed under the terms of the Modified BSD License.
|
|
3
|
-
import { URLExt } from '@jupyterlab/coreutils';
|
|
3
|
+
import { PageConfig, URLExt } from '@jupyterlab/coreutils';
|
|
4
4
|
import { Drive } from '@jupyterlab/services';
|
|
5
5
|
import { WebSocketProvider } from './yprovider';
|
|
6
|
+
const DISABLE_RTC = PageConfig.getOption('disableRTC') === 'true' ? true : false;
|
|
6
7
|
/**
|
|
7
8
|
* The url for the default drive service.
|
|
8
9
|
*/
|
|
@@ -125,7 +126,7 @@ class SharedModelFactory {
|
|
|
125
126
|
/**
|
|
126
127
|
* Whether the IDrive supports real-time collaboration or not.
|
|
127
128
|
*/
|
|
128
|
-
this.collaborative =
|
|
129
|
+
this.collaborative = !DISABLE_RTC;
|
|
129
130
|
this._documentFactories = new Map();
|
|
130
131
|
}
|
|
131
132
|
/**
|
|
@@ -150,7 +151,7 @@ class SharedModelFactory {
|
|
|
150
151
|
console.warn(`Only defined format are supported; got ${options.format}.`);
|
|
151
152
|
return;
|
|
152
153
|
}
|
|
153
|
-
if (!options.collaborative) {
|
|
154
|
+
if (!this.collaborative || !options.collaborative) {
|
|
154
155
|
// Bail if the document model does not support collaboration
|
|
155
156
|
// the `sharedModel` will be the default one.
|
|
156
157
|
return;
|