Select channel when joining through UI
This commit is contained in:
parent
ca23b3ded8
commit
b9f52a8761
7 changed files with 81 additions and 73 deletions
|
@ -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 =>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue