From 838ac9d233d00788370af6ef9d41d50d7c8dc52a Mon Sep 17 00:00:00 2001 From: Abhinav Date: Thu, 16 Jun 2022 12:44:36 +0530 Subject: [PATCH] fix link open in new tab without newTab true --- src/utils/common/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/common/index.ts b/src/utils/common/index.ts index c6810286d..113795fe0 100644 --- a/src/utils/common/index.ts +++ b/src/utils/common/index.ts @@ -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(); }