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:
@@ -1,4 +1,4 @@
|
||||
import { useCallback, useState } from "react";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
|
||||
import { voiceApi } from "@/lib/api";
|
||||
import type { MediaState } from "@/lib/types";
|
||||
@@ -69,6 +69,10 @@ export function useMediaState(): UseMediaStateReturn {
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
refresh();
|
||||
}, [refresh]);
|
||||
|
||||
return { mediaState, refresh, queue, skip, stop, setVolume };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user