Browse Source

Ensure bad route configs don't cause the client to crash

pull/4030/head
Andrew Kingston 5 years ago
parent
commit
030ff0c50e
  1. 4
      packages/client/src/stores/routes.js

4
packages/client/src/stores/routes.js

@ -18,8 +18,8 @@ const createRouteStore = () => {
const fetchRoutes = async () => {
const routeConfig = await API.fetchRoutes()
let routes = []
Object.values(routeConfig.routes).forEach(route => {
Object.entries(route.subpaths).forEach(([path, config]) => {
Object.values(routeConfig.routes || {}).forEach(route => {
Object.entries(route.subpaths || {}).forEach(([path, config]) => {
routes.push({
path,
screenId: config.screenId,

Loading…
Cancel
Save