-
Notifications
You must be signed in to change notification settings - Fork 96
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
fix realtime map issues #144
fix realtime map issues #144
Conversation
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.
I can see that you made several changes, but that's not a test,
Have you seen the tutorial I made?
I'm here for any question
https://www.youtube.com/watch?v=jEWG7nYKk_0
src/pages/RealtimeMapPage.tsx
Outdated
const now = moment() | ||
const oneMinuteAgo = moment().subtract(1, 'minutes') |
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.
We should now use now
, because the API can't guarantee this information will be available. The ETL process may take some time
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.
We should now use
now
, because the API can't guarantee this information will be available. The ETL process may take some time
Can we do that?:
const now = new Date()
const oneMinuteAgo = moment().subtract(1, 'minutes')
const [from, setFrom] = useState(oneMinuteAgo)
const [to, setTo] = useState(moment(now))
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.
My bad - I wanted to say we should not use now
.
If you'll try to load data that hasn't been processed (yet), the backend will return an empty array and the frontend code will memorize it
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.
My bad - I wanted to say we should not use
now
. If you'll try to load data that hasn't been processed (yet), the backend will return an empty array and the frontend code will memorize it
I'm trying to understand the issue. I read it the first time "not" actually:) We should not use now:
I thought you meant the moment api, but now I understand that now as a variable is problematic.
So, as a default, we want the application first render to be four minutes from now (=to in the state), and five minutes ago (= from).
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.
exactly
Honestly, I was confused about whether you wanted to add some tests, or maybe you meant QA and fix bugs, because there were...
So, I can add tests, no problem. But first, we need a code that will make them pass:) |
sure! fixing bugs is great. |
I would love to do the tests also, another PR sounds great:) |
there are some Playwright tests that my PR did not pass. I'm trying to figure out now why:) |
it is missing key of locales |
…lleS/open-bus-map-search into test-realtime-map-issue118
✅ Deploy Preview for astonishing-pothos-5f81bd ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
code looks great, and the functionality seems perfect!
Thank you! That's a great contribution 💪
Thank you ❤️🔥 What a great project to contribute to 💯 |
Description
*Same as DateSelector
screenshots