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

Fixing Redirect Loop in Main.js (and other small fixes) #208

Merged
merged 2 commits into from
Feb 21, 2020

Conversation

mattxwang
Copy link
Collaborator

@mattxwang mattxwang commented Feb 21, 2020

This is a lightning-quick PR to fix a whitescreen issue that we didn't realize was happening; namely, if you had no sketches, you'd be stuck in an infinite whitescreen redirect on the /sketches route. This PR fixes that by adding a check on the current contentType, and moves the check out of the constructor and performing the check at render. It also removes some other unused code in the Main.js file.

Abbreviated changelog:

  • fixes redirect loop to sketches by making sure to check the current contentType, moves it out of the constructor and state scope
  • removes unused renderDropdown() and Dropdown import
  • makes sketches the default renderContent
  • removes redundant renderSketchesPage() function

- most importantly, fixes redirect loop to sketches by removing it (removes Redirect from imports & state)
- removes unused renderDropdown
- makes sketches the default renderContent
- removes redundant renderSketchesPage function
@mattxwang
Copy link
Collaborator Author

Hey @krashanoff or @jamieliu386, can one of you take a quick look and verify that /sketches doesn't break for you when you have no more sketches on this branch?

Copy link
Contributor

@krashanoff krashanoff left a comment

Choose a reason for hiding this comment

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

Hey Matt! Fixed up the issues for me and LGTM in my opinion, but would probably want a second opinion from @jamieliu386.

@jamieliu386
Copy link
Contributor

Hi Matt! The sketches view looks fine to me now, but clicking the editor button in the profile panel gives me a screen that looks like this:
Screen Shot 2020-02-20 at 11 05 59 PM

@mattxwang
Copy link
Collaborator Author

Hi Matt! The sketches view looks fine to me now, but clicking the editor button in the profile panel gives me a screen that looks like this:
Screen Shot 2020-02-20 at 11 05 59 PM

Ah yeah, good catch didn't realize that! Will work on a better route for Editor rn!

but this time, with no infinite loops!
@mattxwang
Copy link
Collaborator Author

Cool, this latest commit should fix that problem. @jamieliu386 do you mind giving it a spin again?

@jamieliu386
Copy link
Contributor

LGTM, thanks Matt!

@mattxwang mattxwang merged commit 07b90bb into master Feb 21, 2020
@mattxwang mattxwang deleted the fixing-main-component branch February 21, 2020 08:22
@mattxwang mattxwang added the bug Something isn't working label Mar 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants