Re-renable Share option for location messages (#7596)
This commit is contained in:
parent
83b0d123c1
commit
b02c6c7953
1 changed files with 18 additions and 24 deletions
|
@ -378,27 +378,25 @@ export default class MessageContextMenu extends React.Component<IProps, IState>
|
||||||
|
|
||||||
let permalink: string | null = null;
|
let permalink: string | null = null;
|
||||||
let permalinkButton: ReactElement | null = null;
|
let permalinkButton: ReactElement | null = null;
|
||||||
if (canShare(mxEvent)) {
|
if (this.props.permalinkCreator) {
|
||||||
if (this.props.permalinkCreator) {
|
permalink = this.props.permalinkCreator.forEvent(this.props.mxEvent.getId());
|
||||||
permalink = this.props.permalinkCreator.forEvent(this.props.mxEvent.getId());
|
|
||||||
}
|
|
||||||
permalinkButton = (
|
|
||||||
<IconizedContextMenuOption
|
|
||||||
iconClassName="mx_MessageContextMenu_iconPermalink"
|
|
||||||
onClick={this.onPermalinkClick}
|
|
||||||
label={_t('Share')}
|
|
||||||
element="a"
|
|
||||||
{
|
|
||||||
// XXX: Typescript signature for AccessibleButton doesn't work properly for non-inputs like `a`
|
|
||||||
...{
|
|
||||||
href: permalink,
|
|
||||||
target: "_blank",
|
|
||||||
rel: "noreferrer noopener",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
permalinkButton = (
|
||||||
|
<IconizedContextMenuOption
|
||||||
|
iconClassName="mx_MessageContextMenu_iconPermalink"
|
||||||
|
onClick={this.onPermalinkClick}
|
||||||
|
label={_t('Share')}
|
||||||
|
element="a"
|
||||||
|
{
|
||||||
|
// XXX: Typescript signature for AccessibleButton doesn't work properly for non-inputs like `a`
|
||||||
|
...{
|
||||||
|
href: permalink,
|
||||||
|
target: "_blank",
|
||||||
|
rel: "noreferrer noopener",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
if (this.canEndPoll(mxEvent)) {
|
if (this.canEndPoll(mxEvent)) {
|
||||||
endPollButton = (
|
endPollButton = (
|
||||||
|
@ -519,10 +517,6 @@ function canForward(event: MatrixEvent): boolean {
|
||||||
return !isLocationEvent(event);
|
return !isLocationEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
function canShare(event: MatrixEvent): boolean {
|
|
||||||
return !isLocationEvent(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
function isLocationEvent(event: MatrixEvent): boolean {
|
function isLocationEvent(event: MatrixEvent): boolean {
|
||||||
const eventType = event.getType();
|
const eventType = event.getType();
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue