aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentDecorations.tsx
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-08-19 22:39:56 -0400
committerSam Wilkins <samwilkins333@gmail.com>2019-08-19 22:39:56 -0400
commit00cecb10d80bad8d717cd06ddc4bf156664b9f2d (patch)
treef68193b3cafd52c19181041a564eb473290fc839 /src/client/views/DocumentDecorations.tsx
parentdf11d1afdb271b37618ab9e1d362b2f4a1145982 (diff)
fixed push pull UI
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
-rw-r--r--src/client/views/DocumentDecorations.tsx14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 80d4ecb9b..797b43add 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -30,6 +30,7 @@ import { ObjectField } from '../../new_fields/ObjectField';
import { MetadataEntryMenu } from './MetadataEntryMenu';
import { ImageBox } from './nodes/ImageBox';
import { CurrentUserUtils } from '../../server/authentication/models/current_user_utils';
+import { Pulls, Pushes } from '../apis/google_docs/GoogleApiClientUtils';
const higflyout = require("@hig/flyout");
export const { anchorPoints } = higflyout;
export const Flyout = higflyout.default;
@@ -626,7 +627,10 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
if (!canPush) return (null);
return (
<div className={"linkButtonWrapper"}>
- <div title="Push to Google Docs" className="linkButton-linker" onClick={() => thisDoc.pushToGoogleDocsTrigger = !thisDoc.pushToGoogleDocsTrigger}>
+ <div title="Push to Google Docs" className="linkButton-linker" onClick={() => {
+ DocumentDecorations.hasPushedHack = false;
+ thisDoc[Pushes] = NumCast(thisDoc[Pushes]) + 1;
+ }}>
<FontAwesomeIcon className="documentdecorations-icon" icon="arrow-alt-circle-up" size="sm" />
</div>
</div>
@@ -639,13 +643,19 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
if (!canPull) return (null);
return (
<div className={"linkButtonWrapper"}>
- <div title="Pull From Google Docs" className="linkButton-linker" onClick={() => thisDoc.pullFromGoogleDocsTrigger = !thisDoc.pullFromGoogleDocsTrigger}>
+ <div title="Pull From Google Docs" className="linkButton-linker" onClick={() => {
+ DocumentDecorations.hasPulledHack = false;
+ thisDoc[Pulls] = NumCast(thisDoc[Pulls]) + 1;
+ }}>
<FontAwesomeIcon className="documentdecorations-icon" icon="arrow-alt-circle-down" size="sm" />
</div>
</div>
);
}
+ public static hasPushedHack = false;
+ public static hasPulledHack = false;
+
considerTooltip = () => {
let thisDoc = SelectionManager.SelectedDocuments()[0].props.Document;
let isTextDoc = thisDoc.data && thisDoc.data instanceof RichTextField;