-
Notifications
You must be signed in to change notification settings - Fork 5
bug fix: handle popstate among networked trajectories while on viewer path #618
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
Conversation
| import { APP_ID, URL_PARAM_KEY_FILE_NAME } from "./constants"; | ||
| import TRAJECTORIES from "./constants/networked-trajectories"; | ||
| import { createReduxStore } from "./state"; | ||
| import { setIsPlaying } from "./state/viewer/actions"; | ||
| import { | ||
| changeToNetworkedFile, | ||
| clearSimulariumFile, | ||
| } from "./state/trajectory/actions"; | ||
| import { getUrlParamValue } from "./util/userUrlHandling"; |
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.
just a touch of organizing
Coverage report
Test suite run success139 tests passing in 8 suites. Report generated by 🧪jest coverage report action from 76bf2a4 |
| const trajectoryId = getUrlParamValue( | ||
| window.location.href, | ||
| URL_PARAM_KEY_FILE_NAME |
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 are already getting the right URL into the address bar, just not loading/clearing.
toloudis
left a comment
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'm assuming this is working code... I had to google popstate event. do we use pushstate events too?
|
ShrimpCryptid
left a comment
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.
LGTM!
… into fix/popstate
Time estimate or Size
small
Problem
Closes #617
If you are at
/viewerhitting back won't actually load the previous trajectory. Same for forward, bug reproduces with local files as well (i.e. navigating back to networked trajectory URL after loading local file).Solution
Added a new
useEffectandhandlePopStatetouseLocationChangeDidn't work with the
[location]dependency of previously existinguseEffectso made a new one.