forked from badges/shields
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix console error before applying a frontend route redirect (badges#3176
- Loading branch information
1 parent
3fc9b81
commit b288c99
Showing
2 changed files
with
6 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,2 @@ | ||
import React from 'react' | ||
import Main from '../components/main' | ||
import redirectLegacyRoutes from '../lib/redirect-legacy-routes' | ||
|
||
export default class IndexPage extends React.Component { | ||
render() { | ||
// It seems like putting this in `componentDidMount()` should work. | ||
// however, that does not seem to be called often enough, resulting in the | ||
// redirect sometimes not occurring. | ||
if (typeof window !== 'undefined') { | ||
redirectLegacyRoutes() | ||
} | ||
|
||
return <Main {...this.props} /> | ||
} | ||
} | ||
export default Main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters