mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-14 21:31:50 +00:00
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: {
|
||||
...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