From 645df1d00f953524c6da22103d26c38ae4331cd6 Mon Sep 17 00:00:00 2001
From: Skitty1238 <157652284+Skitty1238@users.noreply.github.com>
Date: Wed, 4 Jun 2025 13:59:34 -0400
Subject: partial google calendar task integration + fix with dark mode colors
 for task nodes so that text is still visible

---
 src/client/views/nodes/TaskBox.tsx | 69 ++++++++++++++++++--------------------
 1 file changed, 32 insertions(+), 37 deletions(-)

(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 1c7aeeb82..3990356b9 100644
--- a/src/client/views/nodes/TaskBox.tsx
+++ b/src/client/views/nodes/TaskBox.tsx
@@ -270,43 +270,38 @@ export class TaskBox extends React.Component<TaskBoxProps> {
                 )}
 
                 {/** test button */}
-            <button
-            className="task-manager-google"
-            onClick={async () => {
-                console.log('GT button clicked');
-                const token = await GoogleAuthenticationManager.Instance.fetchOrGenerateAccessToken();
-                console.log('Got token', token);
-
-                try {
-                const response = await fetch('/googleTasks/create', {
-                    method: 'POST',
-                    headers: {
-                    'Content-Type': 'application/json',
-                    Authorization: `Bearer ${token}`,
-                    },
-                    body: JSON.stringify({
-                    title: taskTitle || 'Untitled Task',
-                    notes: taskDesc,
-                    due: allDay
-                        ? String(doc.$task_dateRange)?.split('|')[0] + 'T23:59:00Z'
-                        : (doc.$task_endTime instanceof DateField && doc.$task_endTime.date?.toISOString()) || undefined,
-                    }),
-                });
-
-                const result = await response.json();
-                console.log("📬 Google Task result:", result);
-                alert(result?.id ? 'Task sent to Google Tasks!' : `Failed: ${result?.error?.message || 'Unknown error'}`);
-                } catch (err) {
-                console.error("Fetch error:", err);
-                alert("Fetch failed: ");
-                }
-            }}
-            >
-            GT
-            </button>
-
-
-
+                <button
+                    className="task-manager-google"
+                    onClick={async () => {
+                        console.log('GT button clicked');
+                        const token = await GoogleAuthenticationManager.Instance.fetchOrGenerateAccessToken();
+                        console.log('Got token', token);
+
+                        try {
+                            const response = await fetch('/googleTasks/create', {
+                                method: 'POST',
+                                credentials: 'include',
+                                headers: {
+                                    'Content-Type': 'application/json',
+                                    Authorization: `Bearer ${token}`,
+                                },
+                                body: JSON.stringify({
+                                    title: taskTitle || 'Untitled Task',
+                                    notes: taskDesc,
+                                    due: allDay ? String(doc.$task_dateRange)?.split('|')[0] + 'T23:59:00Z' : (doc.$task_endTime instanceof DateField && doc.$task_endTime.date?.toISOString()) || undefined,
+                                }),
+                            });
+
+                            const result = await response.text();
+                            console.log('Google Task result:', result);
+                            alert(result?.id ? 'Task sent to Google Tasks!' : `Failed: ${result?.error?.message || 'Unknown error'}`);
+                        } catch (err) {
+                            console.error('Fetch error:', err);
+                            alert('Fetch failed: ');
+                        }
+                    }}>
+                    GT
+                </button>
             </div>
         );
     }
-- 
cgit v1.2.3-70-g09d2

