Ensure bad route configs don't cause the client to crash
This commit is contained in:
parent
159c951262
commit
d949e2dd23
|
@ -18,8 +18,8 @@ const createRouteStore = () => {
|
||||||
const fetchRoutes = async () => {
|
const fetchRoutes = async () => {
|
||||||
const routeConfig = await API.fetchRoutes()
|
const routeConfig = await API.fetchRoutes()
|
||||||
let routes = []
|
let routes = []
|
||||||
Object.values(routeConfig.routes).forEach(route => {
|
Object.values(routeConfig.routes || {}).forEach(route => {
|
||||||
Object.entries(route.subpaths).forEach(([path, config]) => {
|
Object.entries(route.subpaths || {}).forEach(([path, config]) => {
|
||||||
routes.push({
|
routes.push({
|
||||||
path,
|
path,
|
||||||
screenId: config.screenId,
|
screenId: config.screenId,
|
||||||
|
|
Loading…
Reference in New Issue