Skip to content

Commit

Permalink
πŸ› Fix undefined tab
Browse files Browse the repository at this point in the history
  • Loading branch information
ssakone committed Dec 25, 2023
1 parent d152b49 commit 633d51b
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/lib/services/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const switchIcon = async (activeInfo: { tabId: number }) => {
const user: Profile = await background.getUserProfile();
const domain = urlToDomain(tab.url || '');
const webSites = user.data?.webSites as { [key: string]: WebSite };
if (domain in webSites) {
if (webSites !== undefined && domain in webSites) {
web.action.setIcon({
tabId: tab.id,
path: 'assets/logo-on.png'
Expand Down Expand Up @@ -194,16 +194,10 @@ async function manageRequest(message: Message, resolver: any = null, next: boole
const user = await background.getUserProfile();
const domain = urlToDomain(message.url || '');

// const popupWindow = (await web.windows.getAll()).find((win) => win.type === 'popup');

if (next === false) {
requestQueue.push({ message, resolver: resolve });
return
}
// if (popupWindow !== undefined || requestQueue.length > 0) {
//
// return;
// }

if (user.data?.privateKey === undefined)
return Promise.resolve(
Expand Down

0 comments on commit 633d51b

Please sign in to comment.