3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

dashboard: sort guilds in guild list

This commit is contained in:
Dragory 2019-10-10 23:05:00 +03:00
parent 5de6bf9cfa
commit fc43beee38

View file

@ -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;
},
}),
},
};