[FIX] Disallow empty sharing (#1664)
This commit is contained in:
parent
38c7d8a874
commit
982b1d39e9
|
@ -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 {
|
||||||
|
|
||||||
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 {
|
||||||
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
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue