Keep TabList sorted

This commit is contained in:
Ken-Håvard Lieng 2017-06-29 06:56:05 +02:00
parent 7160db9614
commit 6624a97ce7
4 changed files with 46 additions and 23 deletions

View file

@ -78,6 +78,17 @@ function compareUsers(a, b) {
export const getChannels = state => state.channels;
const key = (v, k) => k.toLowerCase();
export const getSortedChannels = createSelector(
getChannels,
channels => channels.withMutations(c =>
c.forEach((server, address) =>
c.update(address, chans => chans.sortBy(key))
)
).sortBy(key)
);
export const getSelectedChannel = createSelector(
getSelectedTab,
getChannels,