aboutsummaryrefslogtreecommitdiff
path: root/src/fields/Doc.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-09-20 12:58:18 -0400
committerbobzel <zzzman@gmail.com>2022-09-20 12:58:18 -0400
commitb6cd6616784769602b33605a720fe55295c2fbed (patch)
tree39b85d5d0741ec34ff08b2901ffc91898b5f9cea /src/fields/Doc.ts
parent6a6fb81eb84c26001f76ae7fc7f0ed58d8259697 (diff)
parent945c0cd12fb2a792d10800f81b52cbac8aa12a41 (diff)
Merge remote-tracking branch 'origin/mehek-loading-fixes'
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r--src/fields/Doc.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index cf505c45b..74a3d8cf2 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -149,6 +149,28 @@ export class Doc extends RefField {
public static set MainDocId(id: string | undefined) {
this.mainDocId = id;
}
+
+ @observable public static CurrentlyLoading: Doc[];
+ // removes from currently loading display
+ @action
+ public static removeCurrentlyLoading(doc: Doc) {
+ if (Doc.CurrentlyLoading) {
+ const index = Doc.CurrentlyLoading.indexOf(doc);
+ index !== -1 && Doc.CurrentlyLoading.splice(index, 1);
+ }
+ }
+
+ // adds doc to currently loading display
+ @action
+ public static addCurrentlyLoading(doc: Doc) {
+ if (!Doc.CurrentlyLoading) {
+ Doc.CurrentlyLoading = [];
+ }
+ if (Doc.CurrentlyLoading.indexOf(doc) === -1) {
+ Doc.CurrentlyLoading.push(doc);
+ }
+ }
+
@observable public static GuestDashboard: Doc | undefined;
@observable public static GuestTarget: Doc | undefined;
@observable public static GuestMobile: Doc | undefined;