www: use websocket status ended for redirecting

This commit is contained in:
2023-10-12 11:41:02 +02:00
committed by Mathieu Virbel
parent 43016e42aa
commit cc5f1c70a4

View File

@@ -177,6 +177,16 @@ export const useWebSockets = (transcriptId: string | null): UseWebSockets => {
case "FINAL_LONG_SUMMARY":
if (message.data) {
setFinalSummary(message.data);
}
break;
case "FINAL_TITLE":
console.debug("FINAL_TITLE event:", message.data);
break;
case "STATUS":
console.log("STATUS event:", message.data);
if (message.data.value === "ended") {
const newUrl = "/transcripts/" + transcriptId;
router.push(newUrl);
console.debug(
@@ -186,13 +196,6 @@ export const useWebSockets = (transcriptId: string | null): UseWebSockets => {
newUrl,
);
}
break;
case "FINAL_TITLE":
console.debug("FINAL_TITLE event:", message.data);
break;
case "STATUS":
setStatus(message.data);
break;