1
0
Fork 0
mirror of synced 2024-07-04 05:50:57 +12:00

Sort routes to ensure the client router always matches correctly

This commit is contained in:
Andrew Kingston 2020-12-08 15:44:35 +00:00
parent 3c6be9d481
commit a926b23720

View file

@ -21,6 +21,12 @@ const createRouteStore = () => {
})
})
})
// Sort route by paths so that the router matches correctly
routes.sort((a, b) => {
return a.path > b.path ? -1 : 1
})
store.update(state => {
state.routes = routes
return state