Skip to content

Commit

Permalink
Fix bug where import after error continues failing (#463)
Browse files Browse the repository at this point in the history
Steps to reproduce:
1. Open https://www.speedscope.app/
2. Try to import an invalid file such as [invalid.json](https://github.com/jlfwong/speedscope/files/14167326/invalid.json). The page says "Something went wrong. Check the JS console for more details."
3. Now try to import a valid file such as [simple.json](https://github.com/jlfwong/speedscope/files/14167335/simple.json). The page says "Something went wrong. Check the JS console for more details." even though this second file is valid.

Explanation of the fix (copied from the commit message):
> We need to clear the error flag, otherwise once there is an error and we display "Something went wrong" we will keep displaying that forever even when the user imports a valid file.
  • Loading branch information
tom93 committed Apr 15, 2024
1 parent 25f671e commit d69f3d0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/views/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ export type ApplicationProps = {

export class Application extends StatelessComponent<ApplicationProps> {
private async loadProfile(loader: () => Promise<ProfileGroup | null>) {
this.props.setError(false)
this.props.setLoading(true)
await new Promise(resolve => setTimeout(resolve, 0))

Expand Down

0 comments on commit d69f3d0

Please sign in to comment.