remove routing TODO

main
Mike Fix 5 years ago
parent f7998ef250
commit 0d26638d1d

@ -128,8 +128,8 @@ export const getRouteState = router => {
.split('/')
.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 {
parameter,

@ -10,7 +10,7 @@ class IdPage extends React.PureComponent {
static contextType = ApiContext
static async getInitialProps({ req, res, query }) {
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
if (parameter) {

@ -10,7 +10,7 @@ class EmbedIdPage extends React.PureComponent {
static contextType = ApiContext
static async getInitialProps({ req, res, query }) {
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
if (parameter) {

Loading…
Cancel
Save