From 554a91a8fe70a4ccdeb489e4526a2283cdff4c1a Mon Sep 17 00:00:00 2001 From: pyphilia Date: Tue, 27 Jul 2021 15:52:15 +0200 Subject: [PATCH] fix: avoid popup blocking when redirecting --- src/utils/navigation.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/utils/navigation.js b/src/utils/navigation.js index 9e743ccf8..a8290d955 100644 --- a/src/utils/navigation.js +++ b/src/utils/navigation.js @@ -1,5 +1,8 @@ // eslint-disable-next-line import/prefer-default-export export const redirect = (url, { openInNewTab = false } = {}) => { - const options = openInNewTab ? '_blank' : null; - window.open(url, options); + if (openInNewTab) { + window.open(url, '_blank'); + } else { + window.location.href = url; + } };