Skip to content

Commit

Permalink
Fix: Considering the scenario when download does not have a data-tags…
Browse files Browse the repository at this point in the history
… attribute
  • Loading branch information
michalpokusa committed Jan 18, 2025
1 parent 59ce4cd commit daa4770
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion assets/javascript/downloads.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ function filterResults() {
// exact tag match re-order
if (downloadsSearch.searchTerm !== null && downloadsSearch.searchTerm !== undefined) {
let searched = downloadsSearch.searchTerm.toLowerCase();
let tags = download.getAttribute("data-tags").split(",");
let tags = download.dataset.tags?.split(",") || [];
if (searched !== "" && tags.indexOf(searched) >= 0) {
let parent = download.parentElement;
parent.removeChild(download);
Expand Down

0 comments on commit daa4770

Please sign in to comment.