aboutsummaryrefslogtreecommitdiff
path: root/src/client/DocServer.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-06-15 09:57:46 -0400
committerbobzel <zzzman@gmail.com>2023-06-15 09:57:46 -0400
commita6181a5695c7355b7996ac6c6c1e7aad886e6302 (patch)
tree21aa88c53a159ff6a69ab6f5f8a72550579ba220 /src/client/DocServer.ts
parentbe0730195d8090337ca5cd007b69615ede354ca8 (diff)
fixed updating server cache when window/tab closes.
Diffstat (limited to 'src/client/DocServer.ts')
-rw-r--r--src/client/DocServer.ts3
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: {