Make React Infinite stop throwing when theres only one child
This commit is contained in:
parent
ae78ac5017
commit
fb77c29fd9
@ -88,13 +88,21 @@ var MessageBox = React.createClass({
|
||||
return <p className="message">{line}</p>;
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="messagebox" style={style}>
|
||||
<Infinite ref="list" containerHeight={this.state.height} elementHeight={24}>
|
||||
{lines}
|
||||
</Infinite>
|
||||
</div>
|
||||
);
|
||||
if (lines.length !== 1) {
|
||||
return (
|
||||
<div className="messagebox" style={style}>
|
||||
<Infinite ref="list" containerHeight={this.state.height} elementHeight={24}>
|
||||
{lines}
|
||||
</Infinite>
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<div className="messagebox" style={style}>
|
||||
<div ref="list">{lines}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -54,7 +54,8 @@ var selectedTabStore = Reflux.createStore({
|
||||
|
||||
userAdded: function(user, server, channel) {
|
||||
// Update the selected channel incase the casing is different
|
||||
if (server === selectedTab.server &&
|
||||
if (selectedTab.channel &&
|
||||
server === selectedTab.server &&
|
||||
user === serverStore.getNick(server) &&
|
||||
channel.toLowerCase() === selectedTab.channel.toLowerCase()) {
|
||||
selectedTab.channel = channel;
|
||||
|
Loading…
Reference in New Issue
Block a user