diff options
author | geireann <60007097+geireann@users.noreply.github.com> | 2020-10-02 20:52:10 +0800 |
---|---|---|
committer | geireann <60007097+geireann@users.noreply.github.com> | 2020-10-02 20:52:10 +0800 |
commit | 805bf106c85f693f6e6d15c06cacd5e16079c707 (patch) | |
tree | 872f84dee5ffcae04fbfe128941c0429f3aee562 /src/client/DocServer.ts | |
parent | 3b14058df2cf9cb444836a6b1fea92835eb51761 (diff) | |
parent | 1dee63242684f02543cf7667b53baa00d10ab6c1 (diff) |
Merge branch 'master' into presentation_v1
Diffstat (limited to 'src/client/DocServer.ts')
-rw-r--r-- | src/client/DocServer.ts | 10 |
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; |