aboutsummaryrefslogtreecommitdiff
path: root/src/client/DocServer.ts
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-08-10 08:31:19 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-08-10 08:31:19 -0400
commit3aea955ae56c1aa0611de09c4a013e9dc5c86c42 (patch)
tree92e9995da9d76c985b677e129234f589f8353884 /src/client/DocServer.ts
parent837a9690b5fe8c3466a9b0c26ca1e484a0e4b253 (diff)
parentc1faf55c78b13db1d478b61cb53113de5ac35cbd (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/DocServer.ts')
-rw-r--r--src/client/DocServer.ts11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/client/DocServer.ts b/src/client/DocServer.ts
index 977eb7772..bf5168c22 100644
--- a/src/client/DocServer.ts
+++ b/src/client/DocServer.ts
@@ -27,9 +27,10 @@ export namespace DocServer {
// indicates whether or not a document is currently being udpated, and, if so, its id
export enum WriteMode {
- Always = 0,
- None = 1,
- SameUser = 2,
+ Default = 0, //Anything goes
+ Playground = 1,
+ LiveReadonly = 2,
+ LivePlayground = 3,
}
const fieldWriteModes: { [field: string]: WriteMode } = {};
@@ -37,7 +38,7 @@ export namespace DocServer {
export function setFieldWriteMode(field: string, writeMode: WriteMode) {
fieldWriteModes[field] = writeMode;
- if (writeMode === WriteMode.Always) {
+ if (writeMode !== WriteMode.Playground) {
const docs = docsWithUpdates[field];
if (docs) {
docs.forEach(doc => Doc.RunCachedUpdate(doc, field));
@@ -47,7 +48,7 @@ export namespace DocServer {
}
export function getFieldWriteMode(field: string) {
- return fieldWriteModes[field];
+ return fieldWriteModes[field] || WriteMode.Default;
}
export function registerDocWithCachedUpdate(doc: Doc, field: string, oldValue: any) {