diff options
author | bobzel <zzzman@gmail.com> | 2022-09-20 12:58:18 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2022-09-20 12:58:18 -0400 |
commit | b6cd6616784769602b33605a720fe55295c2fbed (patch) | |
tree | 39b85d5d0741ec34ff08b2901ffc91898b5f9cea /src/fields/Doc.ts | |
parent | 6a6fb81eb84c26001f76ae7fc7f0ed58d8259697 (diff) | |
parent | 945c0cd12fb2a792d10800f81b52cbac8aa12a41 (diff) |
Merge remote-tracking branch 'origin/mehek-loading-fixes'
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r-- | src/fields/Doc.ts | 22 |
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; |