Fix Pro live Start button staying active while the process is already running.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
39497fa29a
commit
9e267366ef
@ -220,7 +220,9 @@ function isLivePushingRow(row?: LiveProcRow): boolean {
|
||||
}
|
||||
|
||||
function procStartBlocked(row?: LiveProcRow): boolean {
|
||||
return isLivePushingRow(row);
|
||||
// PM2 already online (waiting_source / monitoring / …) must also lock Start —
|
||||
// otherwise Pro lane “开始” stays clickable after start until ffmpeg is_pushing.
|
||||
return isLivePushingRow(row) || pm2StatusOnline(row?.process_status);
|
||||
}
|
||||
|
||||
function proLaneStatusLabel(row: LiveProcRow | undefined, t: TFn): string {
|
||||
@ -696,7 +698,8 @@ function LiveStreamActionBtn({
|
||||
const actionForBusy = busyKind ?? kind;
|
||||
const loading = !!(forThisProc && pb.action === actionForBusy);
|
||||
const siblingBusy = !!(forThisProc && pb.action !== actionForBusy);
|
||||
const blockStart = kind === "start" && pushing;
|
||||
// Start locks on pushing OR process online (waiting source still counts as started).
|
||||
const blockStart = kind === "start" && (pushing || online);
|
||||
const blockStop = kind === "stop" && !online;
|
||||
const blockRestart = kind === "restart" && !online;
|
||||
const blocked = blockStart || blockStop || blockRestart;
|
||||
@ -709,7 +712,11 @@ function LiveStreamActionBtn({
|
||||
return;
|
||||
}
|
||||
if (blockStart) {
|
||||
notify(t("已在推流中,无需重复开始", "Already pushing"));
|
||||
notify(
|
||||
pushing
|
||||
? t("已在推流中,无需重复开始", "Already pushing")
|
||||
: t("进程已在运行,请用「停止」或「重新开始」", "Already running — use Stop or Restart"),
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (blockStop) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user