aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/LinkManager.ts
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2024-01-29 14:12:02 -0500
committersrichman333 <sarah_n_richman@brown.edu>2024-01-29 14:12:02 -0500
commit04d0021899a07ec877d470e914cabbd0897cccea (patch)
tree6bdae15eab149f671c8f491618be6f249eb7cec6 /src/client/util/LinkManager.ts
parentd252886fe97524603ee49e577a535a39f1e664ae (diff)
parent1a32884f5084d9c39190e44bd9331e94590322e5 (diff)
merge
Diffstat (limited to 'src/client/util/LinkManager.ts')
-rw-r--r--src/client/util/LinkManager.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/client/util/LinkManager.ts b/src/client/util/LinkManager.ts
index ccb3c6b98..353f28a92 100644
--- a/src/client/util/LinkManager.ts
+++ b/src/client/util/LinkManager.ts
@@ -1,7 +1,7 @@
import { action, makeObservable, observable, observe, runInAction } from 'mobx';
import { computedFn } from 'mobx-utils';
import { Doc, DocListCast, DocListCastAsync, Field, Opt } from '../../fields/Doc';
-import { DirectLinks } from '../../fields/DocSymbols';
+import { DirectLinks, DocData } from '../../fields/DocSymbols';
import { FieldLoader } from '../../fields/FieldLoader';
import { List } from '../../fields/List';
import { ProxyField } from '../../fields/Proxy';
@@ -58,8 +58,8 @@ export class LinkManager {
link &&
action(lAnchProtoProtos => {
Doc.AddDocToList(Doc.UserDoc(), 'links', link);
- lAnchs[0] && Doc.GetProto(lAnchs[0])[DirectLinks].add(link);
- lAnchs[1] && Doc.GetProto(lAnchs[1])[DirectLinks].add(link);
+ lAnchs[0] && lAnchs[0][DocData][DirectLinks].add(link);
+ lAnchs[1] && lAnchs[1][DocData][DirectLinks].add(link);
})
)
)
@@ -74,8 +74,8 @@ export class LinkManager {
Promise.all(lAnchs.map(lAnch => PromiseValue(lAnch?.proto as Doc))).then((lAnchProtos: Opt<Doc>[]) =>
Promise.all(lAnchProtos.map(lAnchProto => PromiseValue(lAnchProto?.proto as Doc))).then(
action(lAnchProtoProtos => {
- link && lAnchs[0] && Doc.GetProto(lAnchs[0])[DirectLinks].delete(link);
- link && lAnchs[1] && Doc.GetProto(lAnchs[1])[DirectLinks].delete(link);
+ link && lAnchs[0] && lAnchs[0][DocData][DirectLinks].delete(link);
+ link && lAnchs[1] && lAnchs[1][DocData][DirectLinks].delete(link);
})
)
)
@@ -162,7 +162,7 @@ export class LinkManager {
return this.relatedLinker(anchor);
} // finds all links that contain the given anchor
public getAllDirectLinks(anchor?: Doc): Doc[] {
- return anchor ? Array.from(Doc.GetProto(anchor)[DirectLinks]) : [];
+ return anchor ? Array.from(anchor[DirectLinks]) : [];
} // finds all links that contain the given anchor
relatedLinker = computedFn(function relatedLinker(this: any, anchor: Doc): Doc[] {