🚸 (bot) Show a popup when the redirect is blocked by browser
Allows us to show a link button to redirect the user anyway
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
import type { RedirectOptions } from 'models'
|
||||
|
||||
export const executeRedirect = ({ url, isNewTab }: RedirectOptions) => {
|
||||
export const executeRedirect = ({
|
||||
url,
|
||||
isNewTab,
|
||||
}: RedirectOptions): { blockedPopupUrl: string } | undefined => {
|
||||
if (!url) return
|
||||
window.open(url, isNewTab ? '_blank' : '_self')
|
||||
const updatedWindow = window.open(url, isNewTab ? '_blank' : '_self')
|
||||
if (!updatedWindow)
|
||||
return {
|
||||
blockedPopupUrl: url,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user