diff options
author | bobzel <zzzman@gmail.com> | 2023-11-29 10:02:34 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-11-29 10:02:34 -0500 |
commit | ba3b3f6f261074bd3f35012bde8730f5d4a36905 (patch) | |
tree | 6f6c7b141f8bc5881113378801d4b2940cfde36a /src/client/views/DocumentButtonBar.tsx | |
parent | ac360607bee82f0fef769eada99dc0b3f85ae70a (diff) |
numerous changes to fix bugs and to fix/remove old or hacky code. fixed doc dec resizing. moving this.rootDoc => this.Document . fixing template artifacts.
Diffstat (limited to 'src/client/views/DocumentButtonBar.tsx')
-rw-r--r-- | src/client/views/DocumentButtonBar.tsx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx index c1ec5b4a4..bd82f7782 100644 --- a/src/client/views/DocumentButtonBar.tsx +++ b/src/client/views/DocumentButtonBar.tsx @@ -574,12 +574,12 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV e.stopPropagation(); }; render() { - if (!this.view0) return null; - - const isText = this.view0.props.Document[this.view0.LayoutFieldKey] instanceof RichTextField; const doc = this.view0?.props.Document; - const considerPull = isText && this.considerGoogleDocsPull; - const considerPush = isText && this.considerGoogleDocsPush; + if (!doc || !this.view0) return null; + + const isText = () => doc[this.view0!.LayoutFieldKey] instanceof RichTextField; + const considerPull = () => isText() && this.considerGoogleDocsPull; + const considerPush = () => isText() && this.considerGoogleDocsPush; return ( <div className="documentButtonBar"> <div className="documentButtonBar-button"> @@ -608,11 +608,11 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV <div className="documentButtonBar-button">{this.recordButton}</div> {!Doc.UserDoc()['documentLinksButton-fullMenu'] ? null : <div className="documentButtonBar-button">{this.shareButton}</div>} {!Doc.UserDoc()['documentLinksButton-fullMenu'] ? null : ( - <div className="documentButtonBar-button" style={{ display: !considerPush ? 'none' : '' }}> + <div className="documentButtonBar-button" style={{ display: !considerPush() ? 'none' : '' }}> {this.considerGoogleDocsPush} </div> )} - <div className="documentButtonBar-button" style={{ display: !considerPull ? 'none' : '' }}> + <div className="documentButtonBar-button" style={{ display: !considerPull() ? 'none' : '' }}> {this.considerGoogleDocsPull} </div> <div className="documentButtonBar-button">{this.menuButton}</div> |