aboutsummaryrefslogtreecommitdiff
path: root/client/js/util
diff options
context:
space:
mode:
authorrr-2016-08-28 23:48:50 +0200
committerrr-2016-08-28 23:48:50 +0200
commit997eb3de63b9258dbd4d7030667b51c4b48f3808 (patch)
treeeee02b0d8595fe384782139e944c94fa35f69b1b /client/js/util
parent4bfdd4c5cbdce75e3b647ef4b9ad9ad8df0a7be2 (diff)
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.
Diffstat (limited to 'client/js/util')
-rw-r--r--client/js/util/misc.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/client/js/util/misc.js b/client/js/util/misc.js
index 629db90..c46f979 100644
--- a/client/js/util/misc.js
+++ b/client/js/util/misc.js
@@ -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);

© 2015 - 2026 Jakob L. Kreuze