fix: remove error message display for Google Drive and OneDrive authentication issues; add toast notifications for picker errors

This commit is contained in:
Anish Sarkar 2026-03-28 23:57:57 +05:30
parent ea218b7be6
commit 101e426792
4 changed files with 7 additions and 5 deletions

View file

@ -1,6 +1,7 @@
"use client";
import { useCallback, useEffect, useRef, useState } from "react";
import { toast } from "sonner";
import { authenticatedFetch } from "@/lib/auth-utils";
export interface OneDrivePickerItem {
@ -241,6 +242,7 @@ export function useOneDrivePicker({ connectorId, onPicked }: UseOneDrivePickerOp
openingRef.current = false;
const msg = err instanceof Error ? err.message : "Failed to open OneDrive Picker";
setError(msg);
toast.error("OneDrive Picker failed", { description: msg });
console.error("OneDrive Picker error:", err);
window.dispatchEvent(new Event(ONEDRIVE_PICKER_CLOSE_EVENT));
} finally {