added footer links, added email alias check
This commit is contained in:
@@ -27,15 +27,12 @@ export const SearchElements = () => {
|
||||
useEffect(() => {
|
||||
if (pannelOpen) {
|
||||
const missionEdited = missions?.find((m) => m.id === editingMissionId);
|
||||
console.log("Mission Edited", missionEdited, editingMissionId, missions);
|
||||
if (missionEdited) {
|
||||
const elements = missionEdited.addressOSMways.map((e) => ({
|
||||
...(e as unknown as OSMWay),
|
||||
isSelected: true,
|
||||
}));
|
||||
setSearchElements(elements);
|
||||
} else {
|
||||
setSearchElements([]);
|
||||
}
|
||||
} else {
|
||||
const openMissions = openMissionMarker.map((m) => {
|
||||
|
||||
@@ -338,12 +338,12 @@ export const MissionForm = () => {
|
||||
{...form.register("hpgMissionString")}
|
||||
onChange={(e) => {
|
||||
form.setValue("hpgMissionString", e.target.value);
|
||||
const [name] = e.target.value.split(":");
|
||||
if (
|
||||
form.watch("missionAdditionalInfo").length === 0 ||
|
||||
form.watch("missionAdditionalInfo").startsWith("HPG-Szenario:")
|
||||
!form.watch("missionAdditionalInfo") ||
|
||||
form.watch("missionAdditionalInfo") === name
|
||||
) {
|
||||
const [name] = e.target.value.split(":");
|
||||
form.setValue("missionAdditionalInfo", `HPG-Szenario: ${name}`);
|
||||
form.setValue("missionAdditionalInfo", name || "");
|
||||
}
|
||||
}}
|
||||
className="select select-primary select-bordered w-full mb-2"
|
||||
|
||||
@@ -1,14 +1,25 @@
|
||||
import { ConnectedAircraft } from "@repo/db";
|
||||
import { ConnectedAircraft, Prisma } from "@repo/db";
|
||||
import { usePilotConnectionStore } from "_store/pilot/connectionStore";
|
||||
import { useMrtStore } from "_store/pilot/MrtStore";
|
||||
import { pilotSocket } from "pilot/socket";
|
||||
import { editConnectedAircraftAPI } from "_querys/aircrafts";
|
||||
import { useEffect } from "react";
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
|
||||
export const useButtons = () => {
|
||||
const station = usePilotConnectionStore((state) => state.selectedStation);
|
||||
const connectedAircraft = usePilotConnectionStore((state) => state.connectedAircraft);
|
||||
const connectionStatus = usePilotConnectionStore((state) => state.status);
|
||||
const updateAircraftMutation = useMutation({
|
||||
mutationKey: ["edit-pilot-connected-aircraft"],
|
||||
mutationFn: ({
|
||||
aircraftId,
|
||||
data,
|
||||
}: {
|
||||
aircraftId: number;
|
||||
data: Prisma.ConnectedAircraftUpdateInput;
|
||||
}) => editConnectedAircraftAPI(aircraftId, data),
|
||||
});
|
||||
|
||||
const { page, setPage } = useMrtStore((state) => state);
|
||||
|
||||
@@ -33,8 +44,11 @@ export const useButtons = () => {
|
||||
setPage({ page: "sending-status", station });
|
||||
|
||||
setTimeout(async () => {
|
||||
await editConnectedAircraftAPI(connectedAircraft!.id, {
|
||||
fmsStatus: button,
|
||||
await updateAircraftMutation.mutateAsync({
|
||||
aircraftId: connectedAircraft.id,
|
||||
data: {
|
||||
fmsStatus: button,
|
||||
},
|
||||
});
|
||||
setPage({
|
||||
page: "home",
|
||||
|
||||
Reference in New Issue
Block a user