diff options
author | bob <bcz@cs.brown.edu> | 2019-07-10 12:54:58 -0400 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-07-10 12:54:58 -0400 |
commit | ee7eb826618af78e901db90f7cd28a0f1d45517d (patch) | |
tree | de090e73b445a8f9fb1a5fa16cbbcd15bf9f0dd2 /src/client/views/MainView.tsx | |
parent | bcbfc7435a3b2234d8ac5244c4209d82f1732da0 (diff) | |
parent | fd8fcfe74fff78bc67b6302f917c53e69d598712 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/views/MainView.tsx')
-rw-r--r-- | src/client/views/MainView.tsx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx index b37ba1cb0..dd07fdc3a 100644 --- a/src/client/views/MainView.tsx +++ b/src/client/views/MainView.tsx @@ -13,7 +13,7 @@ import { Id } from '../../new_fields/FieldSymbols'; import { InkTool } from '../../new_fields/InkField'; import { List } from '../../new_fields/List'; import { listSpec } from '../../new_fields/Schema'; -import { Cast, FieldValue, NumCast } from '../../new_fields/Types'; +import { Cast, FieldValue, NumCast, BoolCast } from '../../new_fields/Types'; import { CurrentUserUtils } from '../../server/authentication/models/current_user_utils'; import { RouteStore } from '../../server/RouteStore'; import { emptyFunction, returnOne, returnTrue } from '../../Utils'; @@ -194,6 +194,11 @@ export class MainView extends React.Component { openWorkspace = async (doc: Doc, fromHistory = false) => { CurrentUserUtils.MainDocId = doc[Id]; this.mainContainer = doc; + if (BoolCast(doc.readOnly)) { + DocServer.makeReadOnly(); + } else { + DocServer.makeEditable(); + } fromHistory || HistoryUtil.pushState({ type: "doc", docId: doc[Id], initializers: {} }); const col = await Cast(CurrentUserUtils.UserDocument.optionalRightCollection, Doc); // if there is a pending doc, and it has new data, show it (syip: we use a timeout to prevent collection docking view from being uninitialized) |