Fondation
This commit is contained in:
parent
c97d63e31f
commit
2ec888892c
@ -24,7 +24,6 @@ type Event = {
|
||||
export function CalendarWidget() {
|
||||
const sessionResult = useSession();
|
||||
const { data: session } = sessionResult;
|
||||
const status = sessionResult.status;
|
||||
const [events, setEvents] = useState<Event[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
@ -32,15 +31,16 @@ export function CalendarWidget() {
|
||||
const lastEventCountRef = useRef<number>(-1);
|
||||
|
||||
useEffect(() => {
|
||||
console.log("Calendar Widget - Session Status:", status);
|
||||
const currentStatus = sessionResult.status;
|
||||
console.log("Calendar Widget - Session Status:", currentStatus);
|
||||
console.log("Calendar Widget - Session Data:", session);
|
||||
|
||||
if (status === "loading") {
|
||||
if (currentStatus === "loading") {
|
||||
console.log("Calendar Widget - Session is loading");
|
||||
return;
|
||||
}
|
||||
|
||||
if (status !== "authenticated" || !session) {
|
||||
if (currentStatus !== "authenticated" || !session) {
|
||||
console.log("Calendar Widget - Not authenticated, skipping fetch");
|
||||
setLoading(false);
|
||||
return;
|
||||
@ -201,7 +201,7 @@ export function CalendarWidget() {
|
||||
}, 300000);
|
||||
|
||||
return () => clearInterval(intervalId);
|
||||
}, [session, status, triggerNotification]);
|
||||
}, [session, sessionResult.status, triggerNotification]);
|
||||
|
||||
const formatEventDate = (date: Date, isAllDay: boolean) => {
|
||||
let dateString = "";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user