Skip to content

Commit

Permalink
Fix right click tag removal regex matching incorrect tags
Browse files Browse the repository at this point in the history
Was removing all tags containing the right clicked tag instead of only the right clicked tag
  • Loading branch information
Bergbok committed Jul 1, 2024
1 parent a0ceea2 commit e406eb3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CustomApps/playlist-tags/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "playlist-tags",
"version": "1.7.1",
"version": "1.7.2",
"private": true,
"scripts": {
"build": "spicetify-creator",
Expand Down
4 changes: 2 additions & 2 deletions CustomApps/playlist-tags/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ const App = () => {
break;
}
}}
onContextMenu={() => {removeTagFromAllPlaylists(new RegExp(escapeRegExp(tag))); setFilterQuery(removeStringFromStringArray(filter_query_terms, tag)); updateTagList()}}>{/* {tag} */}
onContextMenu={() => {removeTagFromAllPlaylists(new RegExp((`^${escapeRegExp(tag)}$`))); setFilterQuery(removeStringFromStringArray(filter_query_terms, tag)); updateTagList()}}>{/* {tag} */}
<p dangerouslySetInnerHTML={{ __html: `<span style="color: ${filterQuery.replace(/!/g, '').split(' ').includes(tag) ? 'black' : 'var(--spice-text)'}">${tag}</span>` }}></p>
</SpotifyChip>
);
Expand Down Expand Up @@ -342,7 +342,7 @@ const App = () => {
}
setActiveLink('Search');
}}
onContextMenu={() => {removeTagFromAllPlaylists(new RegExp(tag)); updateTagList()}}>{tag}
onContextMenu={() => {removeTagFromAllPlaylists(new RegExp(`^${escapeRegExp(tag)}$`)); updateTagList()}}>{tag}
</SpotifyChip>
))
}
Expand Down

0 comments on commit e406eb3

Please sign in to comment.