remove routing TODO

main
Mike Fix 5 years ago
parent f7998ef250
commit 0d26638d1d

@ -128,8 +128,8 @@ export const getRouteState = router => {
.split('/') .split('/')
.pop() .pop()
) )
// TODO fix this hack
const parameter = path.length >= 19 && path.indexOf('.') === -1 && path const parameter = path.length >= 19 && path.indexOf('.') < 0 ? path : null
return { return {
parameter, parameter,

@ -10,7 +10,7 @@ class IdPage extends React.PureComponent {
static contextType = ApiContext static contextType = ApiContext
static async getInitialProps({ req, res, query }) { static async getInitialProps({ req, res, query }) {
const path = query.id const path = query.id
const parameter = path && path.length >= 19 && path.indexOf('.') < 0 && path const parameter = path.length >= 19 && path.indexOf('.') < 0 ? path : null
let snippet let snippet
if (parameter) { if (parameter) {

@ -10,7 +10,7 @@ class EmbedIdPage extends React.PureComponent {
static contextType = ApiContext static contextType = ApiContext
static async getInitialProps({ req, res, query }) { static async getInitialProps({ req, res, query }) {
const path = query.id const path = query.id
const parameter = path && path.length >= 19 && path.indexOf('.') < 0 && path const parameter = path.length >= 19 && path.indexOf('.') < 0 ? path : null
let snippet let snippet
if (parameter) { if (parameter) {

Loading…
Cancel
Save