refactor: streamline data fetching in various hooks and components
Deploy to VPS / deploy (push) Successful in 2m39s
Deploy to VPS / deploy (push) Successful in 2m39s
This commit is contained in:
@@ -121,8 +121,6 @@ export default function DashboardPage() {
|
||||
function StatsSection() {
|
||||
const { stats, loading, error, refetch } = useStats();
|
||||
|
||||
if (error) return <ErrorState message={error} onRetry={refetch} />;
|
||||
|
||||
if (loading || !stats) {
|
||||
return (
|
||||
<div className="space-y-5 animate-fade-in-up">
|
||||
|
||||
@@ -16,10 +16,6 @@ export default function MediaPage() {
|
||||
const { mediaState, refresh, queue, skip, stop, setVolume } = useMediaState();
|
||||
const [queueUrl, setQueueUrl] = useState("");
|
||||
|
||||
useEffect(() => {
|
||||
refresh();
|
||||
}, [refresh]);
|
||||
|
||||
// WS subscription for real-time media state
|
||||
useEffect(() => {
|
||||
const unsub = ws.on("media_state", () => refresh());
|
||||
|
||||
@@ -13,11 +13,7 @@ import { useWebSocket } from "@/lib/ws/context";
|
||||
|
||||
export default function RecordingsPage() {
|
||||
const ws = useWebSocket();
|
||||
const { recordings, loading, refresh, remove, prepend } = useRecordings();
|
||||
|
||||
useEffect(() => {
|
||||
refresh();
|
||||
}, [refresh]);
|
||||
const { recordings, loading, remove, prepend } = useRecordings();
|
||||
|
||||
// WS subscription for real-time updates
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user