diff options
author | bobzel <zzzman@gmail.com> | 2024-05-02 00:39:31 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2024-05-02 00:39:31 -0400 |
commit | dd08c20ec6df3fad6ecd6b16c787f10b0c23feb4 (patch) | |
tree | 11f2b1b741369997af567983df0316923e08d780 /src/fields/Doc.ts | |
parent | 76838b7b3842c9b184e6459e29796dd14de37e8d (diff) |
lots more dependency cycle unwinding.
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r-- | src/fields/Doc.ts | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index 5fd053eef..bb6995398 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -224,8 +224,25 @@ export class Doc extends RefField { @observable public static GuestDashboard: Doc | undefined = undefined; @observable public static GuestTarget: Doc | undefined = undefined; @observable public static GuestMobile: Doc | undefined = undefined; + @observable.shallow public static CurrentlyLoading: Doc[] = observable([]); + // removes from currently loading display + public static removeCurrentlyLoading(doc: Doc) { + if (Doc.CurrentlyLoading) { + const index = Doc.CurrentlyLoading.indexOf(doc); + runInAction(() => index !== -1 && Doc.CurrentlyLoading.splice(index, 1)); + } + } + // adds doc to currently loading display + public static addCurrentlyLoading(doc: Doc) { + if (Doc.CurrentlyLoading.indexOf(doc) === -1) { + runInAction(() => Doc.CurrentlyLoading.push(doc)); + } + } - public static AddLink: undefined | ((link: Doc, checkExists?: boolean) => void); + public static AddLink: (link: Doc, checkExists?: boolean) => void; + public static DeleteLink: (link: Doc) => void; + public static Links: (link: Doc | undefined) => Doc[]; + public static getOppositeAnchor: (linkDoc: Doc, anchor: Doc) => Doc | undefined; public static get MySharedDocs() { return DocCast(Doc.UserDoc().mySharedDocs); } // prettier-ignore public static get MyUserDocView() { return DocCast(Doc.UserDoc().myUserDocView); } // prettier-ignore |