mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-02 16:08:31 +00:00
Fix routing issues. (Closes #407)
This commit is contained in:
parent
c5564150b1
commit
6fd2e8a2ba
1 changed files with 6 additions and 2 deletions
|
@ -79,7 +79,11 @@ export default class FineRouter extends Module {
|
|||
}
|
||||
|
||||
const parts = parse(path),
|
||||
score = parts.length,
|
||||
score = parts.reduce((total, val) => total + (
|
||||
typeof val === 'string' ?
|
||||
val.split('/').length - 1 :
|
||||
0
|
||||
), 0),
|
||||
route = this.routes[name] = {
|
||||
name,
|
||||
parts,
|
||||
|
@ -89,6 +93,6 @@ export default class FineRouter extends Module {
|
|||
}
|
||||
|
||||
this.__routes.push(route);
|
||||
this.__routes.sort(r => r.score);
|
||||
this.__routes.sort((a,b) => b.score - a.score);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue