aboutsummaryrefslogtreecommitdiff
path: root/src/client/DocServer.ts
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-08-09 15:01:42 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-08-09 15:01:42 -0400
commit4b358bfc1122f91b907305c15fc4214d7fc74a4c (patch)
tree1c0dc031102a8a748cc41bdc64bf5958dcb1cd8a /src/client/DocServer.ts
parent68f613b5e762649b743059e494e9307eb103ff0d (diff)
Compile errors and Fixed read only modes
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) {