added auto disconnect when changing link

This commit is contained in:
PxlLoewe
2025-06-02 15:04:15 -07:00
parent 72998a36a4
commit af36b82221
9 changed files with 72 additions and 5 deletions

View File

@@ -81,6 +81,7 @@ pilotSocket.on("connect_error", (err) => {
pilotSocket.on("disconnect", () => {
usePilotConnectionStore.setState({ status: "disconnected", message: "" });
useAudioStore.getState().disconnect();
});
pilotSocket.on("force-disconnect", (reason: string) => {
@@ -95,7 +96,6 @@ pilotSocket.on("aircraft-update", (data) => {
usePilotConnectionStore.setState({
connectedAircraft: data,
});
/* useMrtStore.getState().setLines(getNew); */
});
pilotSocket.on("mission-alert", (data: Mission & { Stations: Station[] }) => {