aboutsummaryrefslogtreecommitdiff
path: root/src/client/DocServer.ts
diff options
context:
space:
mode:
authorusodhi <61431818+usodhi@users.noreply.github.com>2020-07-30 23:29:49 +0530
committerusodhi <61431818+usodhi@users.noreply.github.com>2020-07-30 23:29:49 +0530
commitb3762dd0626712b9801fc8751ceb8bafc1229b16 (patch)
treee56ed4cb5b4165f9a5d83289f1f8627557fd71b5 /src/client/DocServer.ts
parenta61c116e9028c2778b5c48cd596f9cb00d80d0f6 (diff)
parentd6aaa436f3f733166c48a1fa38ca6946f30f0bd7 (diff)
Merge branch 'menu_restructure' of https://github.com/browngraphicslab/Dash-Web into menu_restructure
Diffstat (limited to 'src/client/DocServer.ts')
-rw-r--r--src/client/DocServer.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client/DocServer.ts b/src/client/DocServer.ts
index 8ded43468..dec8724c6 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, fetchProto, FieldsSym } from '../fields/Doc';
+import { Opt, Doc, fetchProto, FieldsSym, UpdatingFromServer } from '../fields/Doc';
import { Utils, emptyFunction } from '../Utils';
import { SerializationHelper } from './util/SerializationHelper';
import { RefField } from '../fields/RefField';
@@ -228,6 +228,7 @@ export namespace DocServer {
// deserialize
const field = await SerializationHelper.Deserialize(fieldJson);
if (force && field instanceof Doc && cached instanceof Doc) {
+ cached[UpdatingFromServer] = true;
Array.from(Object.keys(field)).forEach(key => {
const fieldval = field[key];
if (fieldval instanceof ObjectField) {
@@ -235,6 +236,8 @@ export namespace DocServer {
}
cached[key] = field[key];
});
+ cached[UpdatingFromServer] = false;
+ return cached;
}
else if (field !== undefined) {
_cache[id] = field;