-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DT-6175 part 3 - more refactoring #4934
Conversation
- do not pass redundant props - do not refilter already filtered itineraries - refactor
- Filter once after fetching data, not at every access - Merge bike + public itineraries into single array - Reduce endless and confusing use of derived state variables
- export named functions - add utility function to extract leg mode
Also, fix some prop type errors, and simplify state variable use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a conflict.
Pure bicycle itineraries don't show up anymore.
with HSL config (cars enabled) the following itinerary search crashed: /reitti/Valittu sijainti%3A%3A60.350679325290315%2C24.472990036010742/Valittu sijainti%3A%3A60.16536744905669%2C24.84404146671295?time=1705615030
with stack trace:
Other improvements: - more renaming to make things understandable - reduce use of unnecessary duplicate state variables
- filter relaxed plan after query, not when accessing it - remove silly complex looking 'nop' functions - use bettern names
Prop change processing seems to check topics and subscribe if necessary
- remove nonsense check which compares config change - sensible loading state management - rename and simplify
Itinerary page has 50% less code than before, and basic functionality works. Error messages and notifiers still need refactoring.
@@ -31,14 +32,14 @@ export const StreetModeSelectorButton = ( | |||
const duration = durationToString(itinerary.duration * 1000); | |||
let distance = 0; | |||
switch (name) { | |||
case 'WALK': | |||
case streetHash.walk: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was it 'WALK'? Does this work?
No description provided.