Fix navigate not working

This commit is contained in:
Lim Chee Aun 2023-10-01 14:38:28 +08:00
parent 359fd92ae0
commit baa2605d27

View file

@ -258,11 +258,14 @@ function Hashtags({ columnMode, ...props }) {
onClick={(e) => { onClick={(e) => {
hashtags.splice(i, 1); hashtags.splice(i, 1);
hashtags.sort(); hashtags.sort();
navigate( // navigate(
instance // instance
? `/${instance}/t/${hashtags.join('+')}` // ? `/${instance}/t/${hashtags.join('+')}`
: `/t/${hashtags.join('+')}`, // : `/t/${hashtags.join('+')}`,
); // );
location.hash = instance
? `/${instance}/t/${hashtags.join('+')}`
: `/t/${hashtags.join('+')}`;
}} }}
> >
<Icon icon="x" alt="Remove hashtag" class="danger-icon" /> <Icon icon="x" alt="Remove hashtag" class="danger-icon" />
@ -317,7 +320,8 @@ function Hashtags({ columnMode, ...props }) {
} }
if (newInstance) { if (newInstance) {
newInstance = newInstance.toLowerCase().trim(); newInstance = newInstance.toLowerCase().trim();
navigate(`/${newInstance}/t/${hashtags.join('+')}`); // navigate(`/${newInstance}/t/${hashtags.join('+')}`);
location.hash = `/${newInstance}/t/${hashtags.join('+')}`;
} }
}} }}
> >