aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/TaskBox.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-06-04 21:05:03 -0400
committerbobzel <zzzman@gmail.com>2025-06-04 21:05:03 -0400
commit8d424c8cb4d178d5fb92b6543d63fa409eb6430b (patch)
treea2b34b3e161b316403956d7407df7d2afe27546c /src/client/views/nodes/TaskBox.tsx
parent09be9002b5aa8f5ad7c602bcef6b53bbe0398cd3 (diff)
changed google authentication to not reload the page.
Diffstat (limited to 'src/client/views/nodes/TaskBox.tsx')
-rw-r--r--src/client/views/nodes/TaskBox.tsx11
1 files changed, 10 insertions, 1 deletions
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<TaskBoxProps> {
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', {