fix link open in new tab without newTab true

This commit is contained in:
Abhinav 2022-06-16 12:44:36 +05:30
parent f69c848f96
commit 838ac9d233

View file

@ -73,7 +73,9 @@ export const promiseWithTimeout = async (
export function openLink(href: string, newTab?: boolean) {
const a = document.createElement('a');
a.href = href;
a.target = newTab && '_blank';
if (newTab) {
a.target = '_blank';
}
a.rel = 'noreferrer noopener';
a.click();
}