fixed marker position beeing updated on Validation
This commit is contained in:
@@ -241,9 +241,6 @@ router.post("/:id/hpg-validation-result", async (req, res) => {
|
|||||||
const newMission = await prisma.mission.update({
|
const newMission = await prisma.mission.update({
|
||||||
where: { id: Number(missionId) },
|
where: { id: Number(missionId) },
|
||||||
data: {
|
data: {
|
||||||
// save position of new mission
|
|
||||||
addressLat: result.state === "POSITION_AMANDED" ? result.lat : undefined,
|
|
||||||
addressLng: result.state === "POSITION_AMANDED" ? result.lng : undefined,
|
|
||||||
hpgLocationLat: result.lat,
|
hpgLocationLat: result.lat,
|
||||||
hpgLocationLng: result.lng,
|
hpgLocationLng: result.lng,
|
||||||
hpgValidationState: result.state,
|
hpgValidationState: result.state,
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import axios from "axios";
|
|||||||
import { useDispatchConnectionStore } from "_store/dispatch/connectionStore";
|
import { useDispatchConnectionStore } from "_store/dispatch/connectionStore";
|
||||||
import { changeDispatcherAPI } from "_querys/dispatcher";
|
import { changeDispatcherAPI } from "_querys/dispatcher";
|
||||||
import { getRadioStream } from "_helpers/radioEffect";
|
import { getRadioStream } from "_helpers/radioEffect";
|
||||||
|
import { usePilotConnectionStore } from "_store/pilot/connectionStore";
|
||||||
|
|
||||||
let interval: NodeJS.Timeout;
|
let interval: NodeJS.Timeout;
|
||||||
|
|
||||||
@@ -132,6 +133,19 @@ export const useAudioStore = create<TalkState>((set, get) => ({
|
|||||||
});
|
});
|
||||||
return;
|
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);
|
room.localParticipant.setMicrophoneEnabled(!isTalking);
|
||||||
|
|
||||||
set((state) => ({ isTalking: !state.isTalking, transmitBlocked: false }));
|
set((state) => ({ isTalking: !state.isTalking, transmitBlocked: false }));
|
||||||
@@ -253,6 +267,17 @@ const handlePTT = (data: PTTData) => {
|
|||||||
});
|
});
|
||||||
return;
|
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({
|
useAudioStore.setState({
|
||||||
isTalking: shouldTransmit,
|
isTalking: shouldTransmit,
|
||||||
|
|||||||
@@ -114,8 +114,23 @@ export const ProfileForm: React.FC<ProfileFormProps> = ({ user }: ProfileFormPro
|
|||||||
placeholder="Nachname"
|
placeholder="Nachname"
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
{form.formState.errors.lastname && (
|
<label className="floating-label mb-5 w-full">
|
||||||
<p className="text-error">{form.formState.errors.lastname?.message}</p>
|
<span className="flex items-center gap-2 text-lg">
|
||||||
|
<PersonIcon /> Moodle ID
|
||||||
|
</span>
|
||||||
|
<input
|
||||||
|
{...form.register("moodleId", {
|
||||||
|
valueAsNumber: true,
|
||||||
|
value: null,
|
||||||
|
})}
|
||||||
|
type="text"
|
||||||
|
className="input input-bordered w-full"
|
||||||
|
defaultValue={user?.moodleId || ""}
|
||||||
|
placeholder="Moodle ID"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
{form.formState.errors.moodleId && (
|
||||||
|
<p className="text-error">{form.formState.errors.moodleId?.message}</p>
|
||||||
)}
|
)}
|
||||||
{session.data?.user.permissions.includes("ADMIN_USER_ADVANCED") && (
|
{session.data?.user.permissions.includes("ADMIN_USER_ADVANCED") && (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Reference in New Issue
Block a user