feat: Implement useImageStatus hook and enhance image loading status handling across various components to address cached images and loading timeouts.

This commit is contained in:
pradeepkumar
2026-03-18 11:54:40 +05:30
parent f3c4e31924
commit 772e1024cc
17 changed files with 211 additions and 93 deletions

View File

@@ -1,6 +1,6 @@
'use client';
import { useState } from 'react';
import { useState, useEffect } from 'react';
import { useRouter } from 'next/navigation';
import { signIn } from 'next-auth/react';
import Link from 'next/link';
@@ -15,6 +15,12 @@ export default function LoginPage() {
const [loading, setLoading] = useState(false);
const [userType, setUserType] = useState<'USER' | 'ADMIN'>('USER');
// Clear logout flags on mount so API calls aren't blocked after redirect from logout
useEffect(() => {
localStorage.removeItem('isLoggingOut');
resetLogoutState();
}, []);
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
setLoading(true);