fixed marker position beeing updated on Validation
This commit is contained in:
@@ -20,6 +20,7 @@ import axios from "axios";
|
||||
import { useDispatchConnectionStore } from "_store/dispatch/connectionStore";
|
||||
import { changeDispatcherAPI } from "_querys/dispatcher";
|
||||
import { getRadioStream } from "_helpers/radioEffect";
|
||||
import { usePilotConnectionStore } from "_store/pilot/connectionStore";
|
||||
|
||||
let interval: NodeJS.Timeout;
|
||||
|
||||
@@ -132,6 +133,19 @@ export const useAudioStore = create<TalkState>((set, get) => ({
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const { status: DispatcherConnectionStatus } = useDispatchConnectionStore.getState();
|
||||
const { status: PilotConnectionStatus } = usePilotConnectionStore.getState();
|
||||
if (
|
||||
!isTalking &&
|
||||
!(DispatcherConnectionStatus === "connected" || PilotConnectionStatus === "connected")
|
||||
) {
|
||||
useAudioStore.setState({
|
||||
message: "Keine Verbindung",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
room.localParticipant.setMicrophoneEnabled(!isTalking);
|
||||
|
||||
set((state) => ({ isTalking: !state.isTalking, transmitBlocked: false }));
|
||||
@@ -253,6 +267,17 @@ const handlePTT = (data: PTTData) => {
|
||||
});
|
||||
return;
|
||||
}
|
||||
const { status: DispatcherConnectionStatus } = useDispatchConnectionStore.getState();
|
||||
const { status: PilotConnectionStatus } = usePilotConnectionStore.getState();
|
||||
if (
|
||||
shouldTransmit &&
|
||||
!(DispatcherConnectionStatus === "connected" || PilotConnectionStatus === "connected")
|
||||
) {
|
||||
useAudioStore.setState({
|
||||
message: "Keine Verbindung",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
useAudioStore.setState({
|
||||
isTalking: shouldTransmit,
|
||||
|
||||
Reference in New Issue
Block a user