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) {
api
?.v1TranscriptDeleteParticipant({

View File

@@ -9,7 +9,11 @@ import WaveformLoading from "../../waveformLoading";
import { UseParticipants } from "../../useParticipants";
import { Participant } from "../../../../api";
import { UseTopicWithWords } from "../../useTopicWithWords";
import { TimeSlice, selectedTextIsTimeSlice } from "./page";
import {
TimeSlice,
selectedTextIsSpeaker,
selectedTextIsTimeSlice,
} from "./page";
// TODO shortcuts ?
// 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;
useEffect(() => {
if (topicWithWords.loading) {
// setWordsBySpeaker([]);
if (topicWithWords.loading && selectedTextIsTimeSlice(selectedText)) {
setSelectedText(undefined);
console.log("unsetting topic changed");
}