diff options
author | bobzel <zzzman@gmail.com> | 2023-11-02 19:30:19 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-11-02 19:30:19 -0400 |
commit | eec81f7e0b53395e3e2ea25663a9ea06ec83085d (patch) | |
tree | bb10e997cf9d5d0719049723de5728279bf67b0d /src/client/views/nodes/DocumentLinksButton.tsx | |
parent | 1bba63b1d15cfe76393424a768d2dbc0f0b8cffb (diff) |
performance fixes - don't invalidate as much by using reactions in place of computd values; don't make things active when things are dragged unless CanEmbed; fix for linkBox to use reaction.
Diffstat (limited to 'src/client/views/nodes/DocumentLinksButton.tsx')
-rw-r--r-- | src/client/views/nodes/DocumentLinksButton.tsx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/client/views/nodes/DocumentLinksButton.tsx b/src/client/views/nodes/DocumentLinksButton.tsx index 4db0bf5fa..a26d2e9f3 100644 --- a/src/client/views/nodes/DocumentLinksButton.tsx +++ b/src/client/views/nodes/DocumentLinksButton.tsx @@ -27,6 +27,7 @@ interface DocumentLinksButtonProps { StartLink?: boolean; //whether the link HAS been started (i.e. now needs to be completed) ShowCount?: boolean; scaling?: () => number; // how uch doc is scaled so that link buttons can invert it + hideCount?: () => boolean; } @observer export class DocumentLinksButton extends React.Component<DocumentLinksButtonProps, {}> { @@ -239,6 +240,7 @@ export class DocumentLinksButton extends React.Component<DocumentLinksButtonProp } render() { + if (this.props.hideCount?.()) return null; const menuTitle = this.props.StartLink ? 'Drag or tap to start link' : 'Tap to complete link'; const buttonTitle = 'Tap to view links; double tap to open link collection'; const title = this.props.ShowCount ? buttonTitle : menuTitle; |