From 99028f27788740d377fec3504f9370412cd2947d Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Sat, 9 May 2020 16:57:23 -0400 Subject: fixed google docs prompt problem. --- src/client/apis/GoogleAuthenticationManager.tsx | 1 - .../views/nodes/formattedText/FormattedTextBox.tsx | 16 +++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/client/apis/GoogleAuthenticationManager.tsx b/src/client/apis/GoogleAuthenticationManager.tsx index 018c980d8..22d6fb582 100644 --- a/src/client/apis/GoogleAuthenticationManager.tsx +++ b/src/client/apis/GoogleAuthenticationManager.tsx @@ -36,7 +36,6 @@ export default class GoogleAuthenticationManager extends React.Component<{}> { public fetchOrGenerateAccessToken = async (displayIfFound = false) => { let response: any = await Networking.FetchFromServer("/readGoogleAccessToken"); - // if this is an authentication url, activate the UI to register the new access token if (new RegExp(AuthenticationUrl).test(response)) { this.isOpen = true; diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx index 63552321b..f3c277e20 100644 --- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx +++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx @@ -790,15 +790,13 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp } checkState = (exportState: Opt, dataDoc: Doc) => { - GoogleAuthenticationManager.Instance.fetchOrGenerateAccessToken().then(() => { - if (exportState && this._editorView) { - const equalContent = isEqual(this._editorView.state.doc, exportState.state.doc); - const equalTitles = dataDoc.title === exportState.title; - const unchanged = equalContent && equalTitles; - dataDoc.unchanged = unchanged; - DocumentButtonBar.Instance.setPullState(unchanged); - } - }); + if (exportState && this._editorView) { + const equalContent = isEqual(this._editorView.state.doc, exportState.state.doc); + const equalTitles = dataDoc.title === exportState.title; + const unchanged = equalContent && equalTitles; + dataDoc.unchanged = unchanged; + DocumentButtonBar.Instance.setPullState(unchanged); + } } clipboardTextSerializer = (slice: Slice): string => { -- cgit v1.2.3-70-g09d2