Skip to content

Commit

Permalink
Fix asPath length bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mfix22 committed Oct 23, 2017
1 parent 96ac36b commit 1277a11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pages/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Editor extends React.Component {
static async getInitialProps({ asPath }) {
try {
// TODO fix this hack
if (asPath.length > 30) {
if (asPath.length >= 20 && asPath.indexOf('.') === -1) {
const content = await api.getGist(asPath)
return { content }
}
Expand Down

0 comments on commit 1277a11

Please sign in to comment.