diff options
author | srichman333 <sarah_n_richman@brown.edu> | 2023-06-21 13:24:33 -0400 |
---|---|---|
committer | srichman333 <sarah_n_richman@brown.edu> | 2023-06-21 13:24:33 -0400 |
commit | 875196c24f3adc8cfff09a5351d933c35aba1305 (patch) | |
tree | d3feae0e2f6f5f320596f66fc21c6dc95ce82793 /src/client/DocServer.ts | |
parent | 9eb563e6d1765e9cb7fa674399bbc2695f93336e (diff) | |
parent | 1bc15f9b408d35639cea37ea1c29e7cdbd326301 (diff) |
Merge branch 'master' into collaboration-sarah
Diffstat (limited to 'src/client/DocServer.ts')
-rw-r--r-- | src/client/DocServer.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/client/DocServer.ts b/src/client/DocServer.ts index 02b047a95..2a7f5a09b 100644 --- a/src/client/DocServer.ts +++ b/src/client/DocServer.ts @@ -37,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[] = []; @@ -51,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: { |