From d0be9837f119930b069831e03524c0e8233aad8c Mon Sep 17 00:00:00 2001 From: Ryan Herbert Date: Thu, 12 Oct 2017 09:57:10 +0200 Subject: [PATCH] autocomplete.js remove duplicates in loadData group_ids With some recent changes, we did some nasty things to get public tags working correctly on patient/run/set creation. But now we have an issue of tags loading twice if a group appears twice in the textarea data. --- browser/js/autocomplete.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/browser/js/autocomplete.js b/browser/js/autocomplete.js index 1e25b7da5..118b2c93d 100644 --- a/browser/js/autocomplete.js +++ b/browser/js/autocomplete.js @@ -192,6 +192,9 @@ VidjilAutoComplete.prototype = { loadData : function($input, at, group_ids) { this.isLoadingData[at] = false; + group_ids = group_ids.filter(function(item, pos, self) { + return self.indexOf(item) == pos; + }) this.loadedGroups = group_ids.sort(); var loaded_data = []; -- GitLab