Skip to content

Commit a01abef

Browse files
authored
upgrade extension UI (#136)
1 parent 61540b8 commit a01abef

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

extension/content.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ $(document).ready(function () {
77
if (!loaded) {
88
loaded = true;
99
const splits = location.pathname.split('/').filter(s => s);
10-
if (splits.length === 2 && $("#repo-stars-counter-star").length > 0) {
10+
if (splits.length >= 2 && $("#repo-stars-counter-star").length > 0) {
1111
itemId = splits[0] + ':' + splits[1];
1212
// mark read
13-
chrome.runtime.sendMessage({ read: itemId }, () => { });
13+
if (splits.length == 2) {
14+
chrome.runtime.sendMessage({ read: itemId }, () => { });
15+
}
1416
// get neighbors
1517
loadSimilarRepos();
1618
} else if (splits.length === 0) {
@@ -159,8 +161,8 @@ async function showRecommend(result) {
159161
let exploreDiv = $("[aria-label='Explore']");
160162
exploreDiv.children("[aria-label='GitRec']").remove();
161163
let template = `
162-
<div class="mb-3 dashboard-changelog &lt;color-bg-default border color-border-default p-3 rounded-2" aria-label="GitRec">
163-
<h2 class="f5 text-bold mb-3">Explore repositories</h2>`;
164+
<div class="mb-3 dashboard-changelog color-bg-default border color-border-muted p-3 rounded-3" aria-label="GitRec">
165+
<h2 class="f5 text-bold mb-3 width-full dashboard-changelog__title">Explore repositories</h2>`;
164166
if (result.message) {
165167
let errorMessage = "";
166168
if (result.message.startsWith('API rate limit exceeded')) {

0 commit comments

Comments
 (0)