forked from badges/shields
-
Notifications
You must be signed in to change notification settings - Fork 1
/
component---frontend-pages-index-js-3ffb7c141aae95538bb4.js.map
1 lines (1 loc) · 1.52 KB
/
component---frontend-pages-index-js-3ffb7c141aae95538bb4.js.map
1
{"version":3,"sources":["webpack:///./frontend/pages/index.js","webpack:///./frontend/lib/redirect-legacy-routes.js"],"names":["IndexPage","render","window","hash","location","startsWith","category","replace","navigate","redirectLegacyRoutes","react_default","a","createElement","main","this","props","React","Component"],"mappings":"+MAIqBA,4FACnBC,OAAA,WAQE,MAJsB,oBAAXC,QCPA,WAAgC,IACrCC,EAASD,OAAOE,SAAhBD,KACR,GAAIA,GAAQA,EAAKE,WAAW,eAAgB,CAC1C,IAAMC,EAAWH,EAAKI,QAAQ,cAAe,IAC7CC,mBAAQ,YAAaF,OACH,eAATH,GACTK,mBAAS,YDEPC,GAGKC,EAAAC,EAAAC,cAACC,EAAA,QAASC,KAAKC,WATaC,IAAMC","file":"component---frontend-pages-index-js-3ffb7c141aae95538bb4.js","sourcesContent":["import React from 'react'\nimport Main from '../components/main'\nimport redirectLegacyRoutes from '../lib/redirect-legacy-routes'\n\nexport default class IndexPage extends React.Component {\n render() {\n // It seems like putting this in `componentDidMount()` should work.\n // however, that does not seem to be called often enough, resulting in the\n // redirect sometimes not occurring.\n if (typeof window !== 'undefined') {\n redirectLegacyRoutes()\n }\n\n return <Main {...this.props} />\n }\n}\n","import { navigate } from 'gatsby'\n\nexport default function redirectLegacyRoutes() {\n const { hash } = window.location\n if (hash && hash.startsWith('#/examples/')) {\n const category = hash.replace('#/examples/', '')\n navigate(`category/${category}`)\n } else if (hash === '#/endpoint') {\n navigate('endpoint')\n }\n}\n"],"sourceRoot":""}