Skip to content
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

Handle nil case for scheduled arrivals #8

Merged
merged 4 commits into from
Feb 19, 2024
Merged

Conversation

jmwyds
Copy link
Contributor

@jmwyds jmwyds commented Feb 10, 2024

Hey Jordan! Love the updates to Nate's module. I was experiencing some issues with the other module since updating my Node version earlier today. Due to these issues, I was worried I'd have to take it off my mirror until I found yours, so thank you for the updates.

As for the reason for this PR, I frequent a bus stop that runs only on weekdays during work hours, so a good amount of time my mirror would show no options for bus ETAs (shown below).
image

Therefore, I added handling for this case which removes the Direction/Arrival headings and adds a note to the user that there are no planned arrivals.

Additionally, I added a suffix of min or mins respectively to the arrival times. This isn't a huge deal to me but I figured why not. Feel free to take whatever you want from here or nothing at all. Thanks again!
image

Side note, I also noticed that the table re-renders each time an update interval is reached causing a momentary stutter in the display but that is a fix for another day

Return DUE if ETA is 0, add a suffix of min if the value is one, and a suffix of mins if the value is anything else
Handle the case where there are no scheduled arrivals by not showing Direction/Arrival and telling the user 'No planned arrivals'.
Copy link
Owner

@JHWelch JHWelch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmwyds Thanks a bunch for the contribution! Been meaning to add that myself.

Do you mind fixing the linting and test failures? If you're having trouble let me know and I can take a look.

If you could add a add a test for the nil case as well that would be great, but again I can handle that if you can't get it to work.

@jmwyds
Copy link
Contributor Author

jmwyds commented Feb 10, 2024

Do you mind fixing the linting and test failures? If you're having trouble let me know and I can take a look.

If you could add a add a test for the nil case as well that would be great, but again I can handle that if you can't get it to work.

No problem! I should be able to get to addressing that tomorrow.

@JHWelch JHWelch mentioned this pull request Feb 19, 2024
@JHWelch JHWelch merged commit 5824212 into JHWelch:main Feb 19, 2024
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants