Handle channel forwarding and errors better
This commit is contained in:
parent
497934888c
commit
f8e12f5938
15 changed files with 481 additions and 213 deletions
20
client/js/containers/TabListItem.js
Normal file
20
client/js/containers/TabListItem.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { createStructuredSelector } from 'reselect';
|
||||
import get from 'lodash/get';
|
||||
import TabListItem from 'components/TabListItem';
|
||||
import connect from 'utils/connect';
|
||||
|
||||
const mapState = createStructuredSelector({
|
||||
joined: (state, { server, target }) =>
|
||||
get(state, ['channels', server, target, 'joined']),
|
||||
|
||||
error: (state, { server, target }) => {
|
||||
const messages = get(state, ['messages', server, target]);
|
||||
|
||||
if (messages && messages.length > 0) {
|
||||
return messages[messages.length - 1].type === 'error';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
export default connect(mapState)(TabListItem);
|
Loading…
Add table
Add a link
Reference in a new issue