reset sim file data between loads, and clear out blank viewer#88
reset sim file data between loads, and clear out blank viewer#88
Conversation
…arium-website into fix/black-viewer
schoinh
left a comment
There was a problem hiding this comment.
More comments coming, but here is the first batch :D
| // used to decide whether to clear out the viewer | ||
| to={{ | ||
| pathname: VIEWER_PATHNAME, | ||
| state: { localFile: true }, |
schoinh
left a comment
There was a problem hiding this comment.
Okay I'm done! All the comments in this batch are just extra discussion
| // plot data is a separate request, clear it out to avoid | ||
| // wrong plot data sticking around if the request fails | ||
| clearMetaData = receiveMetadata({ | ||
| plotData: initialState.plotData, | ||
| }); |
| export interface ResetAction { | ||
| type: string; | ||
| } |
There was a problem hiding this comment.
The presence of ToggleAction makes me wonder if we should have another generic interface called SimpleAction or something like that that just has { type: string; } as its shape, since it looks like we have a lot of differently named interfaces that are just that. Maybe a todo comment for this if you agree?
| RequestNetworkFileAction, | ||
| RequestLocalFileAction, | ||
| ResetSimFileDataAction, | ||
| ClearCSimFileDataAction, |
There was a problem hiding this comment.
Is the C in ClearCSimFileDataAction a typo or does it stand for something? 😅
schoinh
left a comment
There was a problem hiding this comment.
Looks good, assuming the typo ClearCSimFileDataAction will be fixed
Addressing this issue
To test this:
To do this I made a clear sim file logic that resets a lot of state. I also had to track when the app gets to the
/viewerurl and HOW the user got there (from loading their own trajectory or by going to a blank viewer).Pull request recommendations:
Thanks for contributing!