Skip to content
Snippets Groups Projects
Commit 8f5aed11 authored by Jean-Baptiste Pasquier's avatar Jean-Baptiste Pasquier
Browse files

fix: getRoute last

parent d397040d
No related branches found
No related tags found
1 merge request!301Release/core 0.17
Pipeline #11385 passed
......@@ -12,11 +12,16 @@
let routes = new Set();
const getRoute = (type, returnFirst = false) => {
let availables = components.filter(c=>c.type==type||c.uniq==type);
availables.map(c => {
if(c.extensions) {
c.extensions.forEach(e => availables.push(e.type));
}
});
if(availables.length > 1) {
if(returnFirst) {
return availables[0].route;
} else {
return availables[availables.length-1] .route;
return availables[availables.length-1].route;
}
} else if(availables.length < 1) {
console.error(`No component found for route ${type}`);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment