fix: add timeout to prevent auth loading from hanging indefinitely
This commit is contained in:
1 parent
9c73674c84
commit
8a5658a359
3 files changed
+19
-61
No files matched your search
+1
-4
@@ -24,7 +24,6 @@ interface Prayer {
|
||||
export default function Home() {
|
||||
const [activeTab, setActiveTab] = useState<'home' | 'journal' | 'reflections' | 'settings'>('home');
|
||||
const [prayers, setPrayers] = useState<Prayer[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [editingPrayer, setEditingPrayer] = useState<Prayer | null>(null);
|
||||
|
||||
// Form state
|
||||
@@ -53,8 +52,6 @@ export default function Home() {
|
||||
} catch (error) {
|
||||
console.error('Error loading prayers:', error);
|
||||
toast.error('Failed to load prayers');
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -147,7 +144,7 @@ export default function Home() {
|
||||
}
|
||||
};
|
||||
|
||||
if (authLoading || loading) {
|
||||
if (authLoading) {
|
||||
return (
|
||||
<div className="min-h-screen bg-gradient-to-br from-slate-900 via-black to-slate-800 flex items-center justify-center p-4">
|
||||
<div className="text-center">
|
||||
|
||||
Reference in new issue
Block a user