fix: Update channel change logic to use useCallback for better performance; adjust resource check in VideoSourceSection

This commit is contained in:
zimplexing
2025-07-11 21:44:15 +08:00
parent 6df4f256e9
commit fbe858715a
3 changed files with 15 additions and 13 deletions

View File

@@ -31,7 +31,7 @@ export const VideoSourceSection: React.FC<VideoSourceSectionProps> = ({ onChange
const resourcesList = await api.getResources();
setResources(resourcesList);
if (videoSource.enabledAll && resourcesList.length === 0) {
if (videoSource.enabledAll && Object.keys(videoSource.sources).length === 0) {
const allResourceKeys: { [key: string]: boolean } = {};
for (const resource of resourcesList) {
allResourceKeys[resource.key] = true;