Handle modifiers when clicking on account links

This commit is contained in:
Lim Chee Aun 2024-05-25 13:52:25 +08:00
parent 2c1a6c8cb5
commit c11bbbb2b3

View file

@ -57,9 +57,15 @@ function NameText({
}
onClick={(e) => {
if (external) return;
if (e.shiftKey) return; // Save link? 🤷
e.preventDefault();
e.stopPropagation();
if (onClick) return onClick(e);
if (e.metaKey || e.ctrlKey || e.shiftKey || e.which === 2) {
const internalURL = `#/${instance}/a/${id}`;
window.open(internalURL, '_blank');
return;
}
states.showAccount = {
account,
instance,