mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
client/tags: fix detecting changes to names
Since 243ab15
the order of tag aliases matters, so the changes need to
pick up also permuting - which were ignored before.
This commit is contained in:
@ -252,9 +252,20 @@ function escapeHtml(unsafe) {
|
||||
.replace(/'/g, ''');
|
||||
}
|
||||
|
||||
function arraysDiffer(source1, source2) {
|
||||
function arraysDiffer(source1, source2, orderImportant) {
|
||||
source1 = [...source1];
|
||||
source2 = [...source2];
|
||||
if (orderImportant === true) {
|
||||
if (source1.length !== source2.length) {
|
||||
return true;
|
||||
}
|
||||
for (let i = 0; i < source1.length; i++) {
|
||||
if (source1[i] !== source2[i]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return (
|
||||
source1.filter(value => !source2.includes(value)).length > 0 ||
|
||||
source2.filter(value => !source1.includes(value)).length > 0);
|
||||
|
Reference in New Issue
Block a user