Convert withModal to useModal

This commit is contained in:
Ken-Håvard Lieng 2020-05-03 09:05:16 +02:00
parent 9cf42df1ea
commit 530e08b9ee
32 changed files with 791 additions and 737 deletions

View file

@ -1,5 +1,6 @@
import { socket as socketActions } from 'state/actions';
import { getWrapWidth, appSet } from 'state/app';
import { getConnected, getWrapWidth, appSet } from 'state/app';
import { searchChannels } from 'state/channelSearch';
import { addMessages } from 'state/messages';
import { setSettings } from 'state/settings';
import { when } from 'utils/observe';
@ -12,6 +13,13 @@ function loadState({ store }, env) {
type: socketActions.SERVERS,
data: env.servers
});
when(store, getConnected, () =>
// Cache top channels for each server
env.servers.forEach(({ host }) =>
store.dispatch(searchChannels(host, ''))
)
);
}
if (env.channels) {