From 888c3a7063a0df55c83215df1758c62ff588761d Mon Sep 17 00:00:00 2001 From: Zack Spear Date: Wed, 30 Aug 2023 16:25:43 -0700 Subject: [PATCH] fix: actions open in new link if connect iframe --- web/store/callback.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/store/callback.ts b/web/store/callback.ts index 3e1474a68..16abedea0 100644 --- a/web/store/callback.ts +++ b/web/store/callback.ts @@ -123,7 +123,7 @@ export const useCallbackStoreGeneric = ( ) => defineStore('callback', () => { const callbackActions = useCallbackActions(); - const send = (url: string, payload: SendPayloads) => { + const send = (url: string, payload: SendPayloads, newTab: boolean = false) => { console.debug('[callback.send]'); const stringifiedData = JSON.stringify({ actions: [...payload], @@ -138,6 +138,10 @@ export const useCallbackStoreGeneric = ( const destinationUrl = new URL(url); destinationUrl.searchParams.set('data', encodeURI(encryptedMessage)); console.debug('[callback.send]', encryptedMessage, destinationUrl); + if (newTab) { + window.open(destinationUrl.toString(), '_blank'); + return; + } window.location.href = destinationUrl.toString(); };