From 0437a5649962e13b5d7f10513c13cfc54f87c717 Mon Sep 17 00:00:00 2001 From: Arnab Dutta Date: Fri, 2 Feb 2024 20:39:14 +0530 Subject: [PATCH] fix: agama Lab's tab closing automatically if same window has tarp opened #7621 (#7632) * fix: agama Lab's tab closing automatically if same window has tarp opened #7621 Signed-off-by: Arnab Dutta * fix: agama Lab's tab closing automatically if same window has tarp opened #7621 Signed-off-by: Arnab Dutta --------- Signed-off-by: Arnab Dutta --- demos/jans-tarp/src/options/oidcClientDetails.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/demos/jans-tarp/src/options/oidcClientDetails.tsx b/demos/jans-tarp/src/options/oidcClientDetails.tsx index 07f3aca3386..de875772ff4 100644 --- a/demos/jans-tarp/src/options/oidcClientDetails.tsx +++ b/demos/jans-tarp/src/options/oidcClientDetails.tsx @@ -71,10 +71,11 @@ const OIDCClientDetails = (data) => { }); }, 1000); - chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => { + chrome.tabs.onUpdated.addListener(function listener(tabId, changeInfo, tab) { if (!!chrome.runtime.lastError) { chrome.tabs.remove(tabId); callback(undefined, chrome.runtime.lastError); + chrome.tabs.onUpdated.removeListener(listener); } if (tabId === tab?.id && changeInfo?.status === "complete") { chrome.tabs.sendMessage(tab.id, { requestId: requestId }, function (response) { @@ -87,11 +88,11 @@ const OIDCClientDetails = (data) => { callback(url, undefined); chrome.tabs.remove(tab.id); setLoading(false); + chrome.tabs.onUpdated.removeListener(listener); } }); }); } - //chrome.tabs.onUpdated.removeListener(tabUpdatedListener); }) }); }