diff options
author | geireann <geireann.lindfield@gmail.com> | 2021-08-27 14:19:25 -0400 |
---|---|---|
committer | geireann <geireann.lindfield@gmail.com> | 2021-08-27 14:19:25 -0400 |
commit | be4fd2492ad706f30af28f33133a4df0e8049e12 (patch) | |
tree | e33b32f54be50122ed16c07d2b6f6b2e79239cb4 /src/client/DocServer.ts | |
parent | c5e96c72fcf149b9bcfe5f7f7a9c714de1d5fd9a (diff) | |
parent | 7c83bc30b3a6ed6061ef68bcef6a0e8941668b3c (diff) |
Merge branch 'master' into schema-view-En-Hua
Diffstat (limited to 'src/client/DocServer.ts')
-rw-r--r-- | src/client/DocServer.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/client/DocServer.ts b/src/client/DocServer.ts index 1d7497cf8..e498a7cca 100644 --- a/src/client/DocServer.ts +++ b/src/client/DocServer.ts @@ -1,6 +1,6 @@ import * as io from 'socket.io-client'; import { MessageStore, YoutubeQueryTypes, GestureContent, MobileInkOverlayContent, UpdateMobileInkOverlayPositionContent, MobileDocumentUploadContent } from "./../server/Message"; -import { Opt, Doc, UpdatingFromServer } from '../fields/Doc'; +import { Opt, Doc, UpdatingFromServer, updateCachedAcls } from '../fields/Doc'; import { Utils, emptyFunction } from '../Utils'; import { SerializationHelper } from './util/SerializationHelper'; import { RefField } from '../fields/RefField'; @@ -61,6 +61,9 @@ export namespace DocServer { DocServer.PlaygroundFields = livePlaygroundFields; livePlaygroundFields.forEach(f => DocServer.setFieldWriteMode(f, DocServer.WriteMode.Playground)); } + export function IsPlaygroundField(field: string) { + return DocServer.PlaygroundFields?.includes(field.replace(/^_/, "")); + } export function setFieldWriteMode(field: string, writeMode: WriteMode) { fieldWriteModes[field] = writeMode; @@ -225,7 +228,7 @@ export namespace DocServer { * the server if the document has not been cached. * @param id the id of the requested document */ - const _GetRefFieldImpl = (id: string, force: boolean = false): Promise<Opt<RefField>> => { + const _GetRefFieldImpl = async (id: string, force: boolean = false): Promise<Opt<RefField>> => { // an initial pass through the cache to determine whether the document needs to be fetched, // is already in the process of being fetched or already exists in the // cache @@ -395,7 +398,7 @@ export namespace DocServer { (_cache[field.id] as any).then((f: any) => fieldMap[field.id] = f); } else if (field) { proms.push(_cache[field.id] as any); - fieldMap[field.id] = field; + fieldMap[field.id] = DocServer.GetCachedRefField(field.id) || field; } } }); |