Simplify state management of viewing page
Explicitly set the page being viewed to "discover" instead of just rendering the discover page if none is set. Eliminates several real or possible bugs and edge cases.
This commit is contained in:
parent
a82ee8a2d5
commit
0b8d9e3d82
1 changed files with 1 additions and 1 deletions
|
@ -81,6 +81,7 @@ var App = React.createClass({
|
|||
drawerOpenRaw = sessionStorage.getItem('drawerOpen');
|
||||
|
||||
return Object.assign(this.getViewingPageAndArgs(window.location.search), {
|
||||
viewingPage: 'discover',
|
||||
drawerOpen: drawerOpenRaw !== null ? JSON.parse(drawerOpenRaw) : true,
|
||||
errorInfo: null,
|
||||
modal: null,
|
||||
|
@ -249,7 +250,6 @@ var App = React.createClass({
|
|||
case 'developer':
|
||||
return ["Developer", "icon-file", <DeveloperPage />];
|
||||
case 'discover':
|
||||
default:
|
||||
return ["Home", "icon-home", <DiscoverPage showWelcome={this.state.justRegistered} {... this.state.pageArgs !== null ? {query: this.state.pageArgs} : {} } />];
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue