aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/formattedText/DashFieldView.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/formattedText/DashFieldView.tsx')
-rw-r--r--src/client/views/nodes/formattedText/DashFieldView.tsx11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/client/views/nodes/formattedText/DashFieldView.tsx b/src/client/views/nodes/formattedText/DashFieldView.tsx
index f23426bb3..72e8aedac 100644
--- a/src/client/views/nodes/formattedText/DashFieldView.tsx
+++ b/src/client/views/nodes/formattedText/DashFieldView.tsx
@@ -101,11 +101,7 @@ export class DashFieldViewInternal extends React.Component<IDashFieldViewInterna
this._textBoxDoc = this.props.tbox.props.Document;
if (this.props.docId) {
- DocServer.GetRefField(this.props.docId).then(
- action(async dashDoc => {
- dashDoc instanceof Doc && (this._dashDoc = dashDoc);
- })
- );
+ DocServer.GetRefField(this.props.docId).then(action(dashDoc => dashDoc instanceof Doc && (this._dashDoc = dashDoc)));
} else {
this._dashDoc = this.props.tbox.rootDoc;
}
@@ -235,10 +231,7 @@ export class DashFieldViewInternal extends React.Component<IDashFieldViewInterna
};
createPivotForField = (e: React.MouseEvent) => {
- let container = this.props.tbox.props.ContainingCollectionView;
- while (container?.props.Document.isTemplateForField || container?.props.Document.isTemplateDoc) {
- container = container.props.ContainingCollectionView;
- }
+ let container = this.props.tbox.props.DocumentView?.().props.docViewPath().lastElement();
if (container) {
const alias = Doc.MakeAlias(container.props.Document);
alias._viewType = CollectionViewType.Time;