Skip to content

Commit

Permalink
Add trim() to messages
Browse files Browse the repository at this point in the history
  • Loading branch information
f-r00t committed May 16, 2024
1 parent 236fa0f commit 98b6f15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ export class GroupChatScreenNoTranslation extends React.Component {

Globals.messagesLoaded = updated_messages.length;

this.setState({messageHasLength: this.state.message.length > 0});
this.setState({messageHasLength: this.state.message.trim().length > 0});
this.scrollView.scrollTo({y: 0, animated: true});
await sendGroupsMessage(checkText(text), this.state.key, temp_timestamp, reply);
this.scrollView.scrollTo({y: 0, animated: true});
Expand Down Expand Up @@ -1210,7 +1210,7 @@ export class GroupChatScreenNoTranslation extends React.Component {
this.props.onChange(text);
}
this.state.message = text;
this.setState({messageHasLength: this.state.message.length > 0});
this.setState({messageHasLength: this.state.message.trim().length > 0});
}}
errorMessage={this.props.error}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/Recipients.js
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ export class ChatScreenNoTranslation extends React.Component {
Keyboard.dismiss();
this.state.input.current._textInput.clear();

this.setState({messageHasLength: this.state.message.length > 0});
this.setState({messageHasLength: this.state.message.trim().length > 0});

let temp_timestamp = Date.now();

Expand Down Expand Up @@ -1191,7 +1191,7 @@ export class ChatScreenNoTranslation extends React.Component {
this.props.onChange(text);
}
this.state.message = text;
this.setState({messageHasLength: this.state.message.length > 0});
this.setState({messageHasLength: this.state.message.trim().length > 0});
}}
errorMessage={this.props.error}
/>
Expand Down

0 comments on commit 98b6f15

Please sign in to comment.