aboutsummaryrefslogtreecommitdiff
path: root/src/client/DocServer.ts
diff options
context:
space:
mode:
authoreperelm2 <emily_perelman@brown.edu>2023-07-05 12:48:02 -0400
committereperelm2 <emily_perelman@brown.edu>2023-07-05 12:48:02 -0400
commitb59241f60140625b80aad5c9455c75fc1f3439ac (patch)
tree59e3aab7ffced8e6081cdb36eb1cad9465db844c /src/client/DocServer.ts
parent5b7a0804fa2bd4b956b3617501619737814bd28b (diff)
parent638a3ce3bcd4aa7287544be82d8d9d07ee963600 (diff)
Merge branch 'master' into secondpropertiesmenu-emily
Diffstat (limited to 'src/client/DocServer.ts')
-rw-r--r--src/client/DocServer.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client/DocServer.ts b/src/client/DocServer.ts
index ba64f993c..2a7f5a09b 100644
--- a/src/client/DocServer.ts
+++ b/src/client/DocServer.ts
@@ -1,7 +1,8 @@
import { runInAction } from 'mobx';
import * as rp from 'request-promise';
import * as io from 'socket.io-client';
-import { Doc, Opt, UpdatingFromServer } from '../fields/Doc';
+import { Doc, Opt } from '../fields/Doc';
+import { UpdatingFromServer } from '../fields/DocSymbols';
import { FieldLoader } from '../fields/FieldLoader';
import { HandleUpdate, Id, Parent } from '../fields/FieldSymbols';
import { ObjectField } from '../fields/ObjectField';
@@ -36,6 +37,7 @@ export namespace DocServer {
return foundDocId ? (_cache[foundDocId] as Doc) : undefined;
}
+ let lastCacheUpdate = 0;
export function UPDATE_SERVER_CACHE(print: boolean = false) {
if (print) {
const strings: string[] = [];
@@ -50,6 +52,8 @@ export namespace DocServer {
if (!(StrCast(doc.author).includes('.edu') || StrCast(doc.author).includes('.com')) || doc.author == Doc.CurrentUserEmail) return true;
return false;
});
+ if (filtered.length === lastCacheUpdate) return;
+ lastCacheUpdate = filtered.length;
rp.post(Utils.prepend('/setCacheDocumentIds'), {
body: {