Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,4 @@ tmp
.docs
.DS_Store
.ssmver/
GitHub Icons/
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "chrome-github-icons",
"description": "Cross-browser extension that replaces GitHub file icons with Material Design icons.",
"private": true,
"version": "0.5.1",
"version": "0.5.2",
"type": "module",
"scripts": {
"sync:assets": "tsx scripts/copy-icons.ts",
Expand Down
10 changes: 5 additions & 5 deletions src/adapters/github/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ export class GitHubAdapter implements SiteAdapter {

originalIcon.style.display = 'none';

if (existingReplacement) {
existingReplacement.src = iconUrl;
return;
}

// Clean up any orphaned replacement images in the same parent
// (happens when GitHub swaps SVGs for open/closed folder states)
const parent = originalIcon.parentElement;
Expand All @@ -81,11 +86,6 @@ export class GitHubAdapter implements SiteAdapter {
.forEach((orphan) => orphan.remove());
}

if (existingReplacement) {
existingReplacement.src = iconUrl;
return;
}

const replacement = this.createReplacementImage(originalIcon, iconUrl);
originalIcon.insertAdjacentElement('afterend', replacement);
}
Expand Down
1 change: 0 additions & 1 deletion src/adapters/github/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const GITHUB_ENTRY_CONTAINER_SELECTOR = [
'[role="treeitem"]',
'[data-testid="tree-view-item"]',
'.PRIVATE_TreeView-item-container',
'.PRIVATE_TreeView-item-content',
'tr.js-navigation-item',
'li.js-navigation-item',
'div[role="row"]',
Expand Down
2 changes: 1 addition & 1 deletion ssmver.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "0.5.1"
version = "0.5.2"

[settings]
mode = "branch"
Expand Down
Loading