fix: Refactor getChannelURL and handleWatchStream for proper URL copying
Some checks failed
CI Pipeline / prepare (push) Waiting to run
CI Pipeline / docker (amd64, ubuntu-24.04) (push) Blocked by required conditions
CI Pipeline / docker (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
CI Pipeline / create-manifest (push) Blocked by required conditions
Build and Push Multi-Arch Docker Image / build-and-push (push) Waiting to run
Frontend Tests / test (push) Has been cancelled

This commit is contained in:
SergeantPanda 2026-05-12 21:17:13 -05:00
parent 336aa7f3cb
commit 705fb6bd66

View file

@ -684,29 +684,32 @@ const ChannelsTable = ({ onReady }) => {
const getChannelURL = useCallback(
(channel) => {
// Make sure we're using the channel UUID consistently
if (!channel || !channel.uuid) {
console.error('Invalid channel object or missing UUID:', channel);
return '';
}
const uri = buildLiveStreamUrl(`/proxy/ts/stream/${channel.uuid}`);
let channelUrl = `${window.location.protocol}//${window.location.host}${uri}`;
const path = `/proxy/ts/stream/${channel.uuid}`;
if (env_mode == 'dev') {
channelUrl = `${window.location.protocol}//${window.location.hostname}:5656${uri}`;
return `${window.location.protocol}//${window.location.hostname}:5656${path}`;
}
return channelUrl;
return `${window.location.protocol}//${window.location.host}${path}`;
},
[env_mode]
);
const handleWatchStream = useCallback(
(channel) => {
const url = getChannelURL(channel);
if (!channel || !channel.uuid) return;
const path = `/proxy/ts/stream/${channel.uuid}`;
const uri = buildLiveStreamUrl(path);
let url = `${window.location.protocol}//${window.location.host}${uri}`;
if (env_mode == 'dev') {
url = `${window.location.protocol}//${window.location.hostname}:5656${uri}`;
}
showVideo(url, 'live', { name: channel.name, channelId: channel.id });
},
[getChannelURL, showVideo]
[env_mode, showVideo]
);
const onRowSelectionChange = (newSelection) => {