Skip to content

Commit

Permalink
fix: hotfix get current tab logo
Browse files Browse the repository at this point in the history
  • Loading branch information
jimcase committed Apr 23, 2024
1 parent 402b5c3 commit dbee6f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/core/background/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,16 +464,21 @@ const createSession = async (
}
}

const tabs = await chrome.tabs.query({ active: true, currentWindow: true });
const tabs = await chrome.tabs.query({});
const tab = tabs.find(t => t.url && new URL(t.url).hostname === urlF.hostname);

if (!tab) {
return failure(new Error(`Error trying to process demo tab: ${tab}`));
}

const newSession: Session = {
id: uid(24),
tunnelAid: createIdentifierResult.data.serder.ked.i,
serverAid,
loggedIn: false,
name: urlF.hostname,
logo: tabs[0]?.favIconUrl
? await convertURLImageToBase64(tabs[0]?.favIconUrl)
logo: tab?.favIconUrl
? await convertURLImageToBase64(tab?.favIconUrl)
: "",
serverOobi: resolveOobiResult.data,
tunnelOobiUrl: getOobiResult.data.oobis[0],
Expand Down
2 changes: 1 addition & 1 deletion src/core/modules/signifyApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class SignifyApi {

await ready();
console.info(`Initialising Signify client...`);
let bran;
let bran = undefined;
try {

bran = (await chrome.storage.local.get([LocalStorageKeys.BRAN]))?.bran;
Expand Down

0 comments on commit dbee6f8

Please sign in to comment.