Skip to content

Commit 515f90f

Browse files
committed
fix: only easy difficulty getting hidden, not medium hard
1 parent c3da6b8 commit 515f90f

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
"js": [
2929
"dist/content-script/get-gpt-access-token.js",
3030
"dist/content-script/get-user-code.js",
31-
"dist/content-script/update-solutions.js",
32-
"dist/content-script/update-description.js"
31+
"dist/content-script/update-solutions-tab.js",
32+
"dist/content-script/update-description-tab.js"
3333
],
3434
"matches": [
3535
"https://leetcode.com/problems/*"

src/content-script/update-description.ts renamed to src/content-script/update-description-tab.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,14 @@ function showExamples() {
2525
function showDifficulty() {
2626
chrome.storage.local.get(['showDifficulty'], (result) => {
2727
let showDifficulty = result.showDifficulty;
28-
let difficultyContainer = document.querySelectorAll('div.bg-olive')[0];
29-
difficultyContainer.style.display = showDifficulty ? 'block' : 'none';
28+
29+
let colors = ['bg-olive', 'bg-yellow', 'bg-red'];
30+
for (let color in colors) {
31+
let difficultyContainer = document.querySelectorAll('div.' + colors[color])[0];
32+
if (difficultyContainer) {
33+
difficultyContainer.style.display = showDifficulty ? 'block' : 'none';
34+
}
35+
}
3036
});
3137
}
3238

0 commit comments

Comments
 (0)