[FIX] Disallow empty sharing (#1664)

This commit is contained in:
Diego Mello 2020-02-05 13:40:44 -03:00 committed by GitHub
parent 38c7d8a874
commit 982b1d39e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -262,6 +262,9 @@ class MessageActions extends React.Component {
handleShare = async() => {
const { message } = this.props;
const permalink = await this.getPermalink(message);
if (!permalink) {
return;
}
Share.share({
message: permalink
});

View File

@ -52,7 +52,7 @@ class InviteUsersView extends React.Component {
share = () => {
const { invite } = this.props;
if (!invite) {
if (!invite || !invite.url) {
return;
}
Share.share({ message: invite.url });

View File

@ -389,6 +389,9 @@ class RoomActionsView extends React.Component {
handleShare = () => {
const { room } = this.state;
const permalink = RocketChat.getPermalinkChannel(room);
if (!permalink) {
return;
}
Share.share({
message: permalink
});