Open ferni7 opened 5 years ago
Probably a regression, will need to investigate.
Have you had a chance to look at this one at all?
Sorry, I have not, will try to take a look soon.
When a flight is filtered I seen it runs: @action toggleFlight(flight) { const { selectedFlights: sel } = this const key = flightKey(flight) const val = sel.has(key) ? !sel.get(key) : false sel.set(key, val)
// Propagate to airlines
if (val) {
this.selectedAirlines.set(flight.airline, true)
}
}
What actually causes the chart to update though and remove any matches for the flight that has just been unchecked?
All the filtering logic is in searchStore.js (which uses mobx, so it "magically" recomputes the result set whenever dependent variables like selectedAirlines
changes). The airline and flight filtering happens in get awards
(which uses the output of get results
).
many thanks for your response I am VERY new with React and mobx and have been attempting to reuse this UI for a different dataset (A much simpler one). Its all working apart from the filters. Hoping its something simple but I'm stuck. Are you on Skype? Would be helpful if you can spare 10mins :)
E-mail me your skype, I'll try and help you out.
thanks, I have emailed you
I created a pull request that fixes this. It's a bit clunky with multi-segment routes in that if you unselect a segment of a particular route, it wont auto unselect the corresponding segment (assuming they were mutually exclusive). Like wise, for a route to show up, all flight segments must be selected.
This used to work in the old version, but ticking/unticking the flight number checkboxes no longer seems to apply any filter that I can tell?