Unverified Commit 982b1d39 authored by Diego Mello's avatar Diego Mello Committed by GitHub
Browse files

[FIX] Disallow empty sharing (#1664)

parent 38c7d8a8
...@@ -262,6 +262,9 @@ class MessageActions extends React.Component { ...@@ -262,6 +262,9 @@ class MessageActions extends React.Component {
handleShare = async() => { handleShare = async() => {
const { message } = this.props; const { message } = this.props;
const permalink = await this.getPermalink(message); const permalink = await this.getPermalink(message);
if (!permalink) {
return;
}
Share.share({ Share.share({
message: permalink message: permalink
}); });
......
...@@ -52,7 +52,7 @@ class InviteUsersView extends React.Component { ...@@ -52,7 +52,7 @@ class InviteUsersView extends React.Component {
share = () => { share = () => {
const { invite } = this.props; const { invite } = this.props;
if (!invite) { if (!invite || !invite.url) {
return; return;
} }
Share.share({ message: invite.url }); Share.share({ message: invite.url });
......
...@@ -389,6 +389,9 @@ class RoomActionsView extends React.Component { ...@@ -389,6 +389,9 @@ class RoomActionsView extends React.Component {
handleShare = () => { handleShare = () => {
const { room } = this.state; const { room } = this.state;
const permalink = RocketChat.getPermalinkChannel(room); const permalink = RocketChat.getPermalinkChannel(room);
if (!permalink) {
return;
}
Share.share({ Share.share({
message: permalink message: permalink
}); });
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment