aboutsummaryrefslogtreecommitdiff
path: root/src/client/DocServer.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-10-01 20:31:39 -0400
committerbobzel <zzzman@gmail.com>2020-10-01 20:31:39 -0400
commit266590937d3fda5dd96729edaa7c9bfac42370d9 (patch)
tree39a0315ff280757c8e07fd4e29a49a9d5e251efd /src/client/DocServer.ts
parentca64e0257cc4dd43e386c17b3d8b7b30747a7d9f (diff)
major performance fix by adding a SharingDocument to the user's DB account so that inquiring the users' UserDoc (and everything it referecens) is no longer necessary.
Diffstat (limited to 'src/client/DocServer.ts')
-rw-r--r--src/client/DocServer.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/client/DocServer.ts b/src/client/DocServer.ts
index d7dfa4498..9683eab45 100644
--- a/src/client/DocServer.ts
+++ b/src/client/DocServer.ts
@@ -9,6 +9,7 @@ import { GestureOverlay } from './views/GestureOverlay';
import MobileInkOverlay from '../mobile/MobileInkOverlay';
import { runInAction } from 'mobx';
import { ObjectField } from '../fields/ObjectField';
+import { StrCast } from '../fields/Types';
/**
* This class encapsulates the transfer and cross-client synchronization of
@@ -25,6 +26,15 @@ import { ObjectField } from '../fields/ObjectField';
*/
export namespace DocServer {
let _cache: { [id: string]: RefField | Promise<Opt<RefField>> } = {};
+
+ export function PRINT_CACHE() {
+ const strings: string[] = [];
+ Array.from(Object.keys(_cache)).forEach(key => {
+ const doc = _cache[key];
+ if (doc instanceof Doc) strings.push(StrCast(doc.author) + " " + StrCast(doc.title) + " " + StrCast(Doc.GetT(doc, "title", "string", true)));
+ });
+ strings.sort().forEach((str, i) => console.log(i.toString() + " " + str));
+ }
export let _socket: SocketIOClient.Socket;
// this client's distinct GUID created at initialization
let GUID: string;