Fix: Radar auth check and data loading
Some checks failed
CI / Frontend Lint & Type Check (push) Has been cancelled
CI / Frontend Build (push) Has been cancelled
CI / Backend Lint (push) Has been cancelled
CI / Backend Tests (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
Deploy / Build & Push Images (push) Has been cancelled
Deploy / Deploy to Server (push) Has been cancelled
Deploy / Notify (push) Has been cancelled
Some checks failed
CI / Frontend Lint & Type Check (push) Has been cancelled
CI / Frontend Build (push) Has been cancelled
CI / Backend Lint (push) Has been cancelled
CI / Backend Tests (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
Deploy / Build & Push Images (push) Has been cancelled
Deploy / Deploy to Server (push) Has been cancelled
Deploy / Notify (push) Has been cancelled
This commit is contained in:
@ -66,7 +66,7 @@ interface SearchResult {
|
|||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
export default function RadarPage() {
|
export default function RadarPage() {
|
||||||
const { isAuthenticated, domains, addDomain, user, subscription, logout } = useStore()
|
const { isAuthenticated, isLoading: authLoading, domains, addDomain, user, subscription, logout, checkAuth } = useStore()
|
||||||
const { toast, showToast, hideToast } = useToast()
|
const { toast, showToast, hideToast } = useToast()
|
||||||
|
|
||||||
const [hotAuctions, setHotAuctions] = useState<HotAuction[]>([])
|
const [hotAuctions, setHotAuctions] = useState<HotAuction[]>([])
|
||||||
@ -81,6 +81,11 @@ export default function RadarPage() {
|
|||||||
|
|
||||||
// Mobile Menu State
|
// Mobile Menu State
|
||||||
const [menuOpen, setMenuOpen] = useState(false)
|
const [menuOpen, setMenuOpen] = useState(false)
|
||||||
|
|
||||||
|
// Check auth on mount
|
||||||
|
useEffect(() => {
|
||||||
|
checkAuth()
|
||||||
|
}, [checkAuth])
|
||||||
|
|
||||||
// Load Data
|
// Load Data
|
||||||
const loadDashboardData = useCallback(async () => {
|
const loadDashboardData = useCallback(async () => {
|
||||||
@ -99,9 +104,15 @@ export default function RadarPage() {
|
|||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isAuthenticated) loadDashboardData()
|
// Wait for auth check to complete, then load data
|
||||||
else setLoadingData(false)
|
if (!authLoading) {
|
||||||
}, [isAuthenticated, loadDashboardData])
|
if (isAuthenticated) {
|
||||||
|
loadDashboardData()
|
||||||
|
} else {
|
||||||
|
setLoadingData(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [authLoading, isAuthenticated, loadDashboardData])
|
||||||
|
|
||||||
// Search
|
// Search
|
||||||
const handleSearch = useCallback(async (domainInput: string) => {
|
const handleSearch = useCallback(async (domainInput: string) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user