Select channel when joining through UI

This commit is contained in:
Ken-Håvard Lieng 2020-06-21 05:33:02 +02:00
parent ca23b3ded8
commit b9f52a8761
7 changed files with 81 additions and 73 deletions

View file

@ -23,6 +23,16 @@ export const getSelectedTab = state => state.tab.selected;
export default createReducer(initialState, {
[actions.SELECT_TAB]: selectTab,
[actions.JOIN](state, { network, channels, selectFirst }) {
if (selectFirst) {
state.selected = {
network,
name: channels[0]
};
state.history.push(state.selected);
}
},
[actions.PART](state, action) {
state.history = state.history.filter(
tab =>