prevent speaker reset when switching topic

This commit is contained in:
Sara
2023-12-12 13:35:04 +01:00
parent c02c3b190c
commit 89dfda29a5
2 changed files with 8 additions and 4 deletions

View File

@@ -207,7 +207,8 @@ const ParticipantList = ({
} }
}; };
const deleteParticipant = (participantId) => () => { const deleteParticipant = (participantId) => (e) => {
e.stopPropagation();
if (!loading) { if (!loading) {
api api
?.v1TranscriptDeleteParticipant({ ?.v1TranscriptDeleteParticipant({

View File

@@ -9,7 +9,11 @@ import WaveformLoading from "../../waveformLoading";
import { UseParticipants } from "../../useParticipants"; import { UseParticipants } from "../../useParticipants";
import { Participant } from "../../../../api"; import { Participant } from "../../../../api";
import { UseTopicWithWords } from "../../useTopicWithWords"; import { UseTopicWithWords } from "../../useTopicWithWords";
import { TimeSlice, selectedTextIsTimeSlice } from "./page"; import {
TimeSlice,
selectedTextIsSpeaker,
selectedTextIsTimeSlice,
} from "./page";
// TODO shortcuts ? // TODO shortcuts ?
// TODO fix key (using indexes might act up, not sure as we don't re-order per say) // TODO fix key (using indexes might act up, not sure as we don't re-order per say)
@@ -31,8 +35,7 @@ const topicWords = ({
const [selectedText, setSelectedText] = stateSelectedText; const [selectedText, setSelectedText] = stateSelectedText;
useEffect(() => { useEffect(() => {
if (topicWithWords.loading) { if (topicWithWords.loading && selectedTextIsTimeSlice(selectedText)) {
// setWordsBySpeaker([]);
setSelectedText(undefined); setSelectedText(undefined);
console.log("unsetting topic changed"); console.log("unsetting topic changed");
} }