1.0.0-rc4 rc4
This commit is contained in:
+23
-2
@@ -65,6 +65,14 @@ function isTerminalStage(value) {
|
||||
return normalized === 'FINISHED' || normalized === 'ERROR' || normalized === 'CANCELLED';
|
||||
}
|
||||
|
||||
function isInteractiveReviewStage(value) {
|
||||
const normalized = normalizeStage(value);
|
||||
return normalized === 'METADATA_LOOKUP'
|
||||
|| normalized === 'METADATA_SELECTION'
|
||||
|| normalized === 'WAITING_FOR_USER_DECISION'
|
||||
|| normalized === 'READY_TO_ENCODE';
|
||||
}
|
||||
|
||||
function parseTimestamp(value) {
|
||||
if (!value) {
|
||||
return 0;
|
||||
@@ -209,8 +217,9 @@ function App() {
|
||||
prevCdDrivesRef.current = current;
|
||||
}, [pipeline?.cdDrives]);
|
||||
|
||||
// Trigger a jobs refresh when a tracked job transitions into a terminal
|
||||
// state through PIPELINE_PROGRESS, so Ripper/History update immediately.
|
||||
// Trigger a jobs refresh when a tracked job transitions into a terminal or
|
||||
// interactive review state through PIPELINE_PROGRESS, so Ripper/History
|
||||
// update immediately without a manual page reload.
|
||||
useEffect(() => {
|
||||
const current = pipeline?.jobProgress && typeof pipeline.jobProgress === 'object'
|
||||
? pipeline.jobProgress
|
||||
@@ -233,6 +242,13 @@ function App() {
|
||||
) {
|
||||
shouldRefresh = true;
|
||||
}
|
||||
if (
|
||||
currentState
|
||||
&& isInteractiveReviewStage(currentState)
|
||||
&& currentState !== previousState
|
||||
) {
|
||||
shouldRefresh = true;
|
||||
}
|
||||
}
|
||||
|
||||
prevJobProgressStatesRef.current = nextStates;
|
||||
@@ -394,6 +410,11 @@ function App() {
|
||||
|
||||
if (message.type === 'PIPELINE_STATE_CHANGED') {
|
||||
setPipeline((prev) => mergePipelineStatePreservingNewestQueue(prev, message.payload));
|
||||
const nextState = normalizeStage(message?.payload?.state);
|
||||
if (isTerminalStage(nextState) || isInteractiveReviewStage(nextState)) {
|
||||
setRipperJobsRefreshToken((token) => token + 1);
|
||||
setHistoryJobsRefreshToken((token) => token + 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (message.type === 'PIPELINE_PROGRESS') {
|
||||
|
||||
Reference in New Issue
Block a user