Skip to content

Commit

Permalink
fix(Card Change): Fixes an issue where resetting a flight or creating…
Browse files Browse the repository at this point in the history
… a new flight would cause clients to remain on the same card, which might not be the first one. Now they will always reset to the first card on flight creation or reset. Closes #2713
  • Loading branch information
Alex Anderson committed Jan 18, 2020
1 parent 41c2e46 commit e06c700
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/events/flight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ App.on("startFlight", ({id = uuid.v4(), name, simulators, flightType, cb}) => {
sim.templateId = s.simulatorId;
sim.mission = s.mission;
sim.executedTimelineSteps = [];
sim.clientCards = {};
sim.stationAssignedCards = {};

const stationSet = App.stationSets.find(ss => ss.id === s.stationSet);
sim.stations = stationSet.stations.map(s => new Classes.Station(s));

Expand Down Expand Up @@ -357,6 +360,8 @@ App.on("resetFlight", ({flightId, simulatorId, full, cb}) => {
newSim.mission = sim.mission;
newSim.stations = sim.stations;
newSim.executedTimelineSteps = [];
newSim.clientCards = {};
newSim.stationAssignedCards = {};

newSim.stationSet = sim.stationSet;
const stationSet = App.stationSets.find(s => s.id === newSim.stationSet);
Expand Down

0 comments on commit e06c700

Please sign in to comment.