diff --git a/d2ypp2/web-console/components/live-product/LiveYoutubeUnmannedView.tsx b/d2ypp2/web-console/components/live-product/LiveYoutubeUnmannedView.tsx index 7ad8659..90ec440 100644 --- a/d2ypp2/web-console/components/live-product/LiveYoutubeUnmannedView.tsx +++ b/d2ypp2/web-console/components/live-product/LiveYoutubeUnmannedView.tsx @@ -914,6 +914,10 @@ export function LiveYoutubeUnmannedView({ }, [channels, activeCh]); const active = channels.find((c) => c.id === activeCh) || channels[0]; + const currentProcChannel = useMemo( + () => channels.find((c) => resolveChannelPm2(c) === currentProc), + [channels, currentProc], + ); const rowForPm2 = useCallback((pm2: string) => liveProcesses.find((p) => p.pm2 === pm2), [liveProcesses]); const statusForPm2 = useCallback( (pm2: string) => rowForPm2(pm2)?.process_status, @@ -925,7 +929,7 @@ export function LiveYoutubeUnmannedView({ const runtimeLogRow = rowForPm2(runtimeLogProc); useEffect(() => { if (mode !== "single" || !preferredSingleProc) return; - if (!currentProc || isYoutubeProPm2(currentProc)) { + if (!currentProc) { currentProcRef.current = preferredSingleProc; setCurrentProc(preferredSingleProc); } @@ -1241,7 +1245,8 @@ export function LiveYoutubeUnmannedView({ } if (m === "single") { const current = currentProcRef.current.trim(); - const target = current && !isYoutubeProPm2(current) ? current : preferredSingleProc || singleProcessOptions[0]?.pm2 || ""; + const activePm2 = active ? resolveChannelPm2(active) : ""; + const target = mode === "pro" ? activePm2 || current : current || preferredSingleProc || singleProcessOptions[0]?.pm2 || ""; if (target) { currentProcRef.current = target; setCurrentProc(target); @@ -1270,6 +1275,7 @@ export function LiveYoutubeUnmannedView({ [ channels, applyProUrlDraft, + active, activeCh, mode, notify, @@ -2606,7 +2612,7 @@ export function LiveYoutubeUnmannedView({ > {currentProc && !singleProcessOptions.some((entry) => entry.pm2 === currentProc) ? ( ) : null}