aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/DocServer.ts14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/client/DocServer.ts b/src/client/DocServer.ts
index 5a34fcf11..e61de86be 100644
--- a/src/client/DocServer.ts
+++ b/src/client/DocServer.ts
@@ -29,12 +29,14 @@ export namespace DocServer {
let _cache: { [id: string]: RefField | Promise<Opt<RefField>> } = {};
export function UPDATE_SERVER_CACHE(print: boolean = false) {
- 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)));
- });
- print && strings.sort().forEach((str, i) => console.log(i.toString() + ' ' + str));
+ if (print) {
+ 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));
+ }
rp.post(Utils.prepend('/setCacheDocumentIds'), {
body: {
cacheDocumentIds: Array.from(Object.keys(_cache)).join(';'),