mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-09-19 05:16:27 -07:00
fix(anki): close the timing review modal once main has dropped the review
Main ends a review on its own after the decision watchdog, on overlay teardown, or when the modal window opened twice, but the renderer only closed on a successful resolve. Every button then answered 'no longer active' forever and the overlay stayed interactive over mpv. Stale results now carry a typed flag and the modal closes on it.
This commit is contained in:
@@ -387,6 +387,10 @@ export function createMediaTimingReviewModal(
|
||||
) {
|
||||
return;
|
||||
}
|
||||
if (!result.ok && result.stale) {
|
||||
closeResolvedReview();
|
||||
return;
|
||||
}
|
||||
const path = result.ok ? buildMediaTimingWaveformPath(result.peaks ?? []) : '';
|
||||
if (!path) {
|
||||
setWaveformState('unavailable');
|
||||
@@ -707,11 +711,13 @@ export function createMediaTimingReviewModal(
|
||||
reviewId: payload.reviewId,
|
||||
decision,
|
||||
});
|
||||
if (!result.ok) {
|
||||
if (!result.ok && !result.stale) {
|
||||
setStatus(result.message ?? 'The timing review could not be resolved.', true);
|
||||
showEditor();
|
||||
return;
|
||||
}
|
||||
// A stale review was already settled by main; keeping the modal up would leave
|
||||
// controls that can never succeed over a live mpv window.
|
||||
closeResolvedReview();
|
||||
} catch (error) {
|
||||
setStatus(error instanceof Error ? error.message : String(error), true);
|
||||
@@ -759,6 +765,10 @@ export function createMediaTimingReviewModal(
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!result.ok && result.stale) {
|
||||
closeResolvedReview();
|
||||
return;
|
||||
}
|
||||
if (!result.ok) {
|
||||
setStatus(result.message ?? 'Audio preview is unavailable.', true);
|
||||
setPreviewPlaying(false);
|
||||
|
||||
Reference in New Issue
Block a user