mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2026-04-21 12:45:19 +00:00
fix: invalidate individual transcript query on TRANSCRIPT_STATUS user event
The UserEventsProvider only invalidated the list query on status changes. The detail page's useTranscriptGet was never refreshed, so it never redirected to /processing on reprocess.
This commit is contained in:
@@ -5,7 +5,12 @@ import { useQueryClient } from "@tanstack/react-query";
|
|||||||
import { WEBSOCKET_URL } from "./apiClient";
|
import { WEBSOCKET_URL } from "./apiClient";
|
||||||
import { useAuth } from "./AuthProvider";
|
import { useAuth } from "./AuthProvider";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { invalidateTranscriptLists, TRANSCRIPT_SEARCH_URL } from "./apiHooks";
|
import {
|
||||||
|
invalidateTranscript,
|
||||||
|
invalidateTranscriptLists,
|
||||||
|
TRANSCRIPT_SEARCH_URL,
|
||||||
|
} from "./apiHooks";
|
||||||
|
import type { NonEmptyString } from "./utils";
|
||||||
|
|
||||||
import type { DagTask } from "./dagTypes";
|
import type { DagTask } from "./dagTypes";
|
||||||
export type { DagTask, DagTaskStatus } from "./dagTypes";
|
export type { DagTask, DagTaskStatus } from "./dagTypes";
|
||||||
@@ -161,6 +166,12 @@ export function UserEventsProvider({
|
|||||||
case "TRANSCRIPT_STATUS": {
|
case "TRANSCRIPT_STATUS": {
|
||||||
invalidateList().then(() => {});
|
invalidateList().then(() => {});
|
||||||
const transcriptId = fullMsg.data?.id as string | undefined;
|
const transcriptId = fullMsg.data?.id as string | undefined;
|
||||||
|
if (transcriptId) {
|
||||||
|
invalidateTranscript(
|
||||||
|
queryClient,
|
||||||
|
transcriptId as NonEmptyString,
|
||||||
|
).then(() => {});
|
||||||
|
}
|
||||||
const status = fullMsg.data?.value as string | undefined;
|
const status = fullMsg.data?.value as string | undefined;
|
||||||
if (transcriptId && status && status !== "processing") {
|
if (transcriptId && status && status !== "processing") {
|
||||||
setDagStatusMap((prev) => {
|
setDagStatusMap((prev) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user