Skip to content

Commit

Permalink
fix: refetch website info if tabCheckin not triggered (#2190)
Browse files Browse the repository at this point in the history
  • Loading branch information
vvvvvv1vvvvvv authored Apr 12, 2024
1 parent 8d8a512 commit df9f0a9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/background/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,15 @@ browser.runtime.onConnect.addListener((port) => {
const origin = getOriginFromUrl(port.sender.url);
const session = sessionService.getOrCreateSession(sessionId, origin);
const req = { data, session, origin };
if (!session?.origin) {
const tabInfo = await browser.tabs.get(sessionId);
// prevent tabCheckin not triggered, re-fetch tab info when session have no info at all
session?.setProp({
origin,
name: tabInfo.title || '',
icon: tabInfo.favIconUrl || '',
});
}
// for background push to respective page
req.session!.setPortMessage(pm);

Expand Down

0 comments on commit df9f0a9

Please sign in to comment.