Skip to content

Commit 88199af

Browse files
authored
Merge pull request #706 from rgantzos/live-stats
2 parents 2b43131 + c807a01 commit 88199af

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

extras/popup/popup.js

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,15 @@ if (window.location.href.includes("extras/index.html")) {
338338
}
339339
}
340340

341+
async function setDefaultThemes() {
342+
if (!(await chrome.storage.sync.get("themes"))?.themes) {
343+
await chrome.storage.sync.set({
344+
themes: defaultThemes,
345+
});
346+
}
347+
}
348+
setDefaultThemes();
349+
341350
async function getThemes() {
342351
document.querySelectorAll(".dropdown > *").forEach(function (el) {
343352
el.remove();
@@ -1365,12 +1374,14 @@ async function getTrending() {
13651374
}
13661375

13671376
async function getCommit() {
1368-
if (!chrome.runtime.getManifest().version_name.endsWith("-beta")) return;
1369-
if (!document.querySelector(".searchbar")) return;
1370-
1371-
let commit = await (await fetch("/.git/ORIG_HEAD")).text();
1372-
document.querySelector(".searchbar").placeholder += ` (${commit.slice(
1373-
0,
1374-
7
1375-
)})`;
1377+
try {
1378+
if (!chrome.runtime.getManifest().version_name.endsWith("-beta")) return;
1379+
if (!document.querySelector(".searchbar")) return;
1380+
1381+
let commit = await (await fetch("/.git/ORIG_HEAD")).text();
1382+
document.querySelector(".searchbar").placeholder += ` (${commit.slice(
1383+
0,
1384+
7
1385+
)})`;
1386+
} catch (err) {}
13761387
}

0 commit comments

Comments
 (0)