Skip to content

Commit 4b64693

Browse files
authored
Merge pull request #12 from apenlor/fix/gmail-favicon
fix(bug): favicon gmail/chat crossing
2 parents 448a4d6 + f4a63a3 commit 4b64693

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gsuite-desktop-client",
3-
"version": "4.0.1",
3+
"version": "4.0.2",
44
"description": "A native desktop client for Google Workspace (Gmail, Calendar, Chat, Drive, Tasks) and Proton (Mail, Calendar), built with Electron.",
55
"author": "apenlor",
66
"homepage": "https://github.com/apenlor/electron-gsuite-client#readme",

preload-web.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,15 @@ let lastBadgeCount = -1;
3636

3737
function getSourceId() {
3838
const href = window.location.href;
39+
3940
if (href.includes("calendar.google.com")) return "calendar";
40-
if (href.includes("mail.google.com/chat")) return "chat";
41+
if (href.includes("mail.google.com/chat") || href.includes("chat.google.com"))
42+
return "chat";
4143
if (href.includes("drive.google.com")) return "drive";
4244
if (href.includes("tasks.google.com")) return "tasks";
43-
return "gmail";
45+
if (href.includes("mail.google.com/mail")) return "gmail";
46+
47+
return null;
4448
}
4549

4650
/**
@@ -236,6 +240,8 @@ function showGenericCalendarNotification() {
236240

237241
document.addEventListener("DOMContentLoaded", () => {
238242
const sourceId = getSourceId();
243+
if (!sourceId) return;
244+
239245
observeFaviconChanges(sourceId);
240246

241247
if (sourceId === "gmail") {

0 commit comments

Comments
 (0)