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