From a12397cf387da7d411184a72f9c128ba6486a631 Mon Sep 17 00:00:00 2001 From: Edijs Date: Wed, 6 Feb 2019 11:34:21 -0700 Subject: [PATCH] Hashtag opens in same tab --- src/components/status/status.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/status/status.js b/src/components/status/status.js index 65ddcb9f..cccb19cc 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -282,8 +282,15 @@ const Status = { this.$router.push(link) return } + } else { + if (target.hostname === window.location.hostname) { + // if the hashtag's target is current instance, open in same tab + this.$router.push(target.pathname) + } else { + // if it is different instance, open in a new tab + window.open(target.href, '_blank') + } } - window.open(target.href, '_blank') } }, toggleReplying () {