Skip to content

Commit

Permalink
Better textarea values pasring.
Browse files Browse the repository at this point in the history
  • Loading branch information
Commifreak committed Feb 26, 2024
1 parent 5b728ea commit 6cd6fc2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pages/content/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,8 @@ function addVolumeToExclude(element) {
$path = $(element).text();
$excludeTextarea = $('#' + $(element).data('container') + '_exclude');

if ($excludeTextarea.val().indexOf($path) !== -1) { // If existing inside textarea
if ($excludeTextarea.val().split(/\r?\n|\r|\n/g).includes($path)) { // If existing inside textarea
console.debug("Not adding this volume to exclusion: already listed!")
return;
}

Expand Down Expand Up @@ -1012,9 +1013,8 @@ function checkVolumesForDuplicates() {
$("code[data-container]").each(function () {
let container = $(this).data('container');
let mapping = $(this).text();
if ($('#' + container + '_exclude').val().indexOf(mapping) !== -1) {
console.debug(container, mapping, 'is excluded so ignored');
} else if (volumeMatrix.includes(mapping)) {

if (volumeMatrix.includes(mapping)) {
affectedMappings.push(mapping);
} else {
volumeMatrix.push($(this).text());
Expand Down

0 comments on commit 6cd6fc2

Please sign in to comment.