From 40f086b6edcd3f60ad43029887c8555b058436fb Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Sat, 28 Mar 2026 17:33:41 +0530 Subject: [PATCH] refactor: replace useAuth with authenticatedFetch in OneDriveConfig and add OneDrive SVG icon --- .../components/onedrive-config.tsx | 5 +- surfsense_web/public/connectors/onedrive.svg | 51 +++++++++++++++++++ 2 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 surfsense_web/public/connectors/onedrive.svg diff --git a/surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/onedrive-config.tsx b/surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/onedrive-config.tsx index e5f6caf06..eda686596 100644 --- a/surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/onedrive-config.tsx +++ b/surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/onedrive-config.tsx @@ -25,7 +25,7 @@ import { } from "@/components/ui/select"; import { Spinner } from "@/components/ui/spinner"; import { Switch } from "@/components/ui/switch"; -import { useAuth } from "@/context/AuthContext"; +import { authenticatedFetch } from "@/lib/auth-utils"; import type { ConnectorConfigProps } from "../index"; interface SelectedItem { @@ -74,7 +74,6 @@ function getFileIconFromName(fileName: string, className = "size-3.5 shrink-0") } export const OneDriveConfig: FC = ({ connector, onConfigChange }) => { - const { authenticatedFetch } = useAuth(); const existingFolders = (connector.config?.selected_folders as SelectedItem[] | undefined) || []; const existingFiles = (connector.config?.selected_files as SelectedItem[] | undefined) || []; const existingIndexingOptions = @@ -137,7 +136,7 @@ export const OneDriveConfig: FC = ({ connector, onConfigCh setBrowseLoading(false); } }, - [connector.id, authenticatedFetch], + [connector.id], ); const handleOpenBrowser = useCallback(() => { diff --git a/surfsense_web/public/connectors/onedrive.svg b/surfsense_web/public/connectors/onedrive.svg new file mode 100644 index 000000000..499a4ade6 --- /dev/null +++ b/surfsense_web/public/connectors/onedrive.svg @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file