fix: keep refresh only in requests tab

This commit is contained in:
2026-04-22 15:41:20 -04:00
parent 65ae7a6924
commit a8c5ef557d
+2 -16
View File
@@ -3,7 +3,6 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
import { toast } from "sonner"; import { toast } from "sonner";
import { RefreshCw } from "lucide-react";
import { import {
Card, Card,
CardContent, CardContent,
@@ -82,7 +81,6 @@ export default function DashboardPage() {
setIsLoading(false); setIsLoading(false);
} }
}; };
const loadCosts = async () => { const loadCosts = async () => {
try { try {
const costsRes = await overseerApi.getCosts(); const costsRes = await overseerApi.getCosts();
@@ -96,20 +94,12 @@ export default function DashboardPage() {
logout(); logout();
router.push("/login"); router.push("/login");
}; };
const handleRefresh = () => {
loadWalletAndPending();
loadCosts();
};
if (isLoading) return <div className="p-8">Loading...</div>; if (isLoading) return <div className="p-8">Loading...</div>;
return ( return (
<div className="p-8 space-y-6"> <div className="p-8 space-y-6">
<div className="flex items-center justify-between"> <div className="flex items-center justify-end">
<Button variant="outline" onClick={handleRefresh}>
<RefreshCw className="mr-2 h-4 w-4" />
Refresh
</Button>
<Button variant="outline" onClick={handleLogout}> <Button variant="outline" onClick={handleLogout}>
Logout Logout
</Button> </Button>
@@ -142,14 +132,10 @@ export default function DashboardPage() {
</div> </div>
</div> </div>
</div> </div>
<div className="mt-4 flex gap-2"> <div className="mt-4">
<Button onClick={() => setIsSearchModalOpen(true)}> <Button onClick={() => setIsSearchModalOpen(true)}>
Request content Request content
</Button> </Button>
<Button variant="secondary" onClick={handleRefresh}>
<RefreshCw className="mr-2 h-4 w-4" />
Check requests
</Button>
</div> </div>
</CardContent> </CardContent>
</Card> </Card>