Skip to content

Commit

Permalink
Resolve chat slowdown issues
Browse files Browse the repository at this point in the history
  • Loading branch information
aminosman committed May 9, 2018
1 parent 53e1d90 commit 72cdc02
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions src/Composer.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ export default class Composer extends React.Component {
}
}

onChangeText(text) {
this.props.onTextChanged(text);
}

render() {
return (
<TextInput
Expand All @@ -37,10 +33,8 @@ export default class Composer extends React.Component {
multiline={this.props.multiline}
onChange={(e) => this.onContentSizeChange(e)}
onContentSizeChange={(e) => this.onContentSizeChange(e)}
onChangeText={(text) => this.onChangeText(text)}
style={[styles.textInput, this.props.textInputStyle, { height: this.props.composerHeight }]}
autoFocus={this.props.textInputAutoFocus}
value={this.props.text}
accessibilityLabel={this.props.text || this.props.placeholder}
enablesReturnKeyAutomatically
underlineColorAndroid="transparent"
Expand Down
2 changes: 1 addition & 1 deletion src/GiftedChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class GiftedChat extends React.Component {
if (!Array.isArray(messages)) {
messages = [messages];
}
return inverted ? messages.concat(currentMessages) : currentMessages.concat(messages);
return inverted ? [...messages, ...currentMessages] : [...currentMessages, ...messages];
}

static prepend(currentMessages = [], messages, inverted = true) {
Expand Down

0 comments on commit 72cdc02

Please sign in to comment.