From 3cd583ee2ddf6d94a06dd45a083c9511843a5779 Mon Sep 17 00:00:00 2001 From: cb-jake <95890768+cb-jake@users.noreply.github.com> Date: Mon, 13 Jan 2025 14:52:27 -0700 Subject: [PATCH] Set popup name to unique string (#1474) * set unique window name * update tests * move popup naming * lint --- packages/wallet-sdk/src/util/web.test.ts | 2 +- packages/wallet-sdk/src/util/web.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/wallet-sdk/src/util/web.test.ts b/packages/wallet-sdk/src/util/web.test.ts index a23c92dbce..3b6ef5dc3a 100644 --- a/packages/wallet-sdk/src/util/web.test.ts +++ b/packages/wallet-sdk/src/util/web.test.ts @@ -37,7 +37,7 @@ describe('PopupManager', () => { expect(window.open).toHaveBeenNthCalledWith( 1, url, - 'Smart Wallet', + expect.stringContaining('wallet_'), 'width=420, height=540, left=302, top=114' ); expect(popup.focus).toHaveBeenCalledTimes(1); diff --git a/packages/wallet-sdk/src/util/web.ts b/packages/wallet-sdk/src/util/web.ts index 7c69208aa2..c02500d2f2 100644 --- a/packages/wallet-sdk/src/util/web.ts +++ b/packages/wallet-sdk/src/util/web.ts @@ -10,12 +10,12 @@ const POPUP_HEIGHT = 540; export function openPopup(url: URL): Window { const left = (window.innerWidth - POPUP_WIDTH) / 2 + window.screenX; const top = (window.innerHeight - POPUP_HEIGHT) / 2 + window.screenY; - appendAppInfoQueryParams(url); + const popupId = `wallet_${crypto.randomUUID()}`; const popup = window.open( url, - 'Smart Wallet', + popupId, `width=${POPUP_WIDTH}, height=${POPUP_HEIGHT}, left=${left}, top=${top}` );