From 4167ed375bd9402e91a998fad8f173fa76b2eec3 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Mon, 3 Dec 2018 16:16:05 +0100 Subject: [PATCH] Fix mention links in detailed statuses not opening in the WebUI --- .../features/status/components/detailed_status.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/javascript/flavours/glitch/features/status/components/detailed_status.js b/app/javascript/flavours/glitch/features/status/components/detailed_status.js index 436c2df0a92..6302f11af7b 100644 --- a/app/javascript/flavours/glitch/features/status/components/detailed_status.js +++ b/app/javascript/flavours/glitch/features/status/components/detailed_status.js @@ -29,7 +29,7 @@ export default class DetailedStatus extends ImmutablePureComponent { }; handleAccountClick = (e) => { - if (e.button === 0) { + if (e.button === 0 && !(e.ctrlKey || e.altKey || e.metaKey)) { e.preventDefault(); this.context.router.history.push(`/accounts/${this.props.status.getIn(['account', 'id'])}`); } @@ -37,6 +37,15 @@ export default class DetailedStatus extends ImmutablePureComponent { e.stopPropagation(); } + parseClick = (e, destination) => { + if (e.button === 0 && !(e.ctrlKey || e.altKey || e.metaKey)) { + e.preventDefault(); + this.context.router.history.push(destination); + } + + e.stopPropagation(); + } + handleOpenVideo = (media, startTime) => { this.props.onOpenVideo(media, startTime); } @@ -122,6 +131,7 @@ export default class DetailedStatus extends ImmutablePureComponent { expanded={expanded} collapsed={false} onExpandedToggle={onToggleHidden} + parseClick={this.parseClick} />