diff --git a/src/components/account.jsx b/src/components/account.jsx
index a996ee26..87feb00f 100644
--- a/src/components/account.jsx
+++ b/src/components/account.jsx
@@ -4,7 +4,7 @@ import { useEffect, useState } from 'preact/hooks';
import emojifyText from '../utils/emojify-text';
import enhanceContent from '../utils/enhance-content';
-import handleAccountLinks from '../utils/handle-account-links';
+import handleContentLinks from '../utils/handle-content-links';
import shortenNumber from '../utils/shorten-number';
import states from '../utils/states';
import store from '../utils/store';
@@ -186,7 +186,7 @@ function Account({ account, onClose }) {
)}
- {uiState !== 'loading' &&
- (titleComponent ? titleComponent : {title}
)}
+ {title && (titleComponent ? titleComponent : {title}
)}
diff --git a/src/utils/handle-account-links.js b/src/utils/handle-content-links.js
similarity index 76%
rename from src/utils/handle-account-links.js
rename to src/utils/handle-content-links.js
index b7156ffc..585671ba 100644
--- a/src/utils/handle-account-links.js
+++ b/src/utils/handle-content-links.js
@@ -1,6 +1,6 @@
import states from './states';
-function handleAccountLinks(opts) {
+function handleContentLinks(opts) {
const { mentions = [] } = opts || {};
return (e) => {
let { target } = e;
@@ -33,8 +33,16 @@ function handleAccountLinks(opts) {
const href = target.getAttribute('href');
states.showAccount = href;
}
+ } else if (
+ target.tagName.toLowerCase() === 'a' &&
+ target.classList.contains('hashtag')
+ ) {
+ e.preventDefault();
+ e.stopPropagation();
+ const tag = target.innerText.replace(/^#/, '').trim();
+ location.hash = `#/t/${tag}`;
}
};
}
-export default handleAccountLinks;
+export default handleContentLinks;