From d7ae6ee1399ac2c1a459fb4b26954e307280fc56 Mon Sep 17 00:00:00 2001
From: Sam Wilkins <samwilkins333@gmail.com>
Date: Tue, 11 Feb 2020 16:58:14 -0500
Subject: button bar push now initiates google auth routine

---
 src/client/views/DocumentButtonBar.tsx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'src/client/views/DocumentButtonBar.tsx')

diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx
index d6029dbe5..ee850922a 100644
--- a/src/client/views/DocumentButtonBar.tsx
+++ b/src/client/views/DocumentButtonBar.tsx
@@ -24,6 +24,7 @@ import React = require("react");
 import { DragManager } from '../util/DragManager';
 import { MetadataEntryMenu } from './MetadataEntryMenu';
 import { CurrentUserUtils } from '../../server/authentication/models/current_user_utils';
+import GoogleAuthenticationManager from '../apis/GoogleAuthenticationManager';
 const higflyout = require("@hig/flyout");
 export const { anchorPoints } = higflyout;
 export const Flyout = higflyout.default;
@@ -162,7 +163,8 @@ export class DocumentButtonBar extends React.Component<{ views: (DocumentView |
             title={`${published ? "Push" : "Publish"} to Google Docs`}
             className="documentButtonBar-linker"
             style={{ animation }}
-            onClick={() => {
+            onClick={async () => {
+                await GoogleAuthenticationManager.Instance.fetchOrGenerateAccessToken();
                 !published && runInAction(() => this.isAnimatingPulse = true);
                 DocumentButtonBar.hasPushedHack = false;
                 targetDoc[Pushes] = NumCast(targetDoc[Pushes]) + 1;
-- 
cgit v1.2.3-70-g09d2

