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 <p className="message">{line}</p>;
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
if (lines.length !== 1) {
|
||||||
<div className="messagebox" style={style}>
|
return (
|
||||||
<Infinite ref="list" containerHeight={this.state.height} elementHeight={24}>
|
<div className="messagebox" style={style}>
|
||||||
{lines}
|
<Infinite ref="list" containerHeight={this.state.height} elementHeight={24}>
|
||||||
</Infinite>
|
{lines}
|
||||||
</div>
|
</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) {
|
userAdded: function(user, server, channel) {
|
||||||
// Update the selected channel incase the casing is different
|
// Update the selected channel incase the casing is different
|
||||||
if (server === selectedTab.server &&
|
if (selectedTab.channel &&
|
||||||
|
server === selectedTab.server &&
|
||||||
user === serverStore.getNick(server) &&
|
user === serverStore.getNick(server) &&
|
||||||
channel.toLowerCase() === selectedTab.channel.toLowerCase()) {
|
channel.toLowerCase() === selectedTab.channel.toLowerCase()) {
|
||||||
selectedTab.channel = channel;
|
selectedTab.channel = channel;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user