added auto disconnect when changing link
This commit is contained in:
@@ -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[] }) => {
|
||||
|
||||
Reference in New Issue
Block a user