From 8d424c8cb4d178d5fb92b6543d63fa409eb6430b Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 4 Jun 2025 21:05:03 -0400 Subject: changed google authentication to not reload the page. --- src/client/views/nodes/TaskBox.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/client/views/nodes/TaskBox.tsx') diff --git a/src/client/views/nodes/TaskBox.tsx b/src/client/views/nodes/TaskBox.tsx index 8855e43c8..df81d9c69 100644 --- a/src/client/views/nodes/TaskBox.tsx +++ b/src/client/views/nodes/TaskBox.tsx @@ -6,7 +6,6 @@ import { DocumentType } from '../../documents/DocumentTypes'; import { FieldView } from './FieldView'; import { DateField } from '../../../fields/DateField'; import { Doc } from '../../../fields/Doc'; -import { Networking } from '../../Network'; import './TaskBox.scss'; import { GoogleAuthenticationManager } from '../../apis/GoogleAuthenticationManager'; @@ -324,6 +323,16 @@ export class TaskBox extends React.Component { console.log('GT button clicked'); try { const token = await GoogleAuthenticationManager.Instance.fetchOrGenerateAccessToken(); + if (token === undefined) { + const listener = () => { + if (confirm('✅ Try again?')) { + // refactor this click function and call it again + } + window.removeEventListener('focusin', listener); + }; + setTimeout(() => window.addEventListener('focusin', listener), 100); + return; + } console.log('Got token', token); const response = await fetch('/googleTasks/create', { -- cgit v1.2.3-70-g09d2