dashboard: sort guilds in guild list
This commit is contained in:
parent
5de6bf9cfa
commit
fc43beee38
1 changed files with 11 additions and 1 deletions
|
@ -60,7 +60,17 @@
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState('guilds', {
|
...mapState('guilds', {
|
||||||
guilds: 'available',
|
guilds: state => {
|
||||||
|
const guilds = Array.from(state.available || []);
|
||||||
|
guilds.sort((a, b) => {
|
||||||
|
if (a.name > b.name) return 1;
|
||||||
|
if (a.name < b.name) return -1;
|
||||||
|
if (a.id > b.id) return 1;
|
||||||
|
if (a.id < b.id) return -1;
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
|
return guilds;
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue