Skip to content

Commit

Permalink
fix: agama Lab's tab closing automatically if same window has tarp op…
Browse files Browse the repository at this point in the history
…ened #7621 (#7632)

* fix: agama Lab's tab closing automatically if same window has tarp opened #7621

Signed-off-by: Arnab Dutta <[email protected]>

* fix: agama Lab's tab closing automatically if same window has tarp opened #7621

Signed-off-by: Arnab Dutta <[email protected]>

---------

Signed-off-by: Arnab Dutta <[email protected]>
  • Loading branch information
duttarnab authored Feb 2, 2024
1 parent c759441 commit 0437a56
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions demos/jans-tarp/src/options/oidcClientDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
})
});
}
Expand Down

0 comments on commit 0437a56

Please sign in to comment.