aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-10-16 15:48:54 -0400
committerbobzel <zzzman@gmail.com>2020-10-16 15:48:54 -0400
commit5816840af60f97a34318a52a5276482cab392496 (patch)
treeeea1b3e86cdda16ea4e2a66cbdfb3cdd880f7cda /src/client/documents
parente6d700159cb6c273a2df0fd02469e72aa5b48c86 (diff)
updated user initialization code to not generate server traffic when creating a new account. set user accounts to update their cache 2.5s after login.
Diffstat (limited to 'src/client/documents')
-rw-r--r--src/client/documents/Documents.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index 45c465d84..d7c9af1a3 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -236,6 +236,8 @@ class EmptyBox {
export namespace Docs {
+ export let newAccount: boolean = false;
+
export namespace Prototypes {
type LayoutSource = { LayoutString: (key: string) => string };
@@ -392,7 +394,7 @@ export namespace Docs {
// non-guid string ids for each document prototype
const prototypeIds = Object.values(DocumentType).filter(type => type !== DocumentType.NONE).map(type => type + suffix);
// fetch the actual prototype documents from the server
- const actualProtos = await DocServer.GetRefFields(prototypeIds);
+ const actualProtos = Docs.newAccount ? {} : await DocServer.GetRefFields(prototypeIds);
// update this object to include any default values: DocumentOptions for all prototypes
prototypeIds.map(id => {