FIX: prevents create row to be displayed if term is in displayed list

This commit is contained in:
Joffrey JAFFEUX 2018-02-27 18:31:58 +01:00 committed by GitHub
parent ba2f01c0bd
commit 9b680fc45c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -1,4 +1,4 @@
const { run } = Ember;
const { run, get } = Ember;
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
@ -47,6 +47,10 @@ export default Ember.Mixin.create({
return false;
}
if (this.get("asyncContent").map(c => get(c, "id")).includes(term)) {
return false;
}
return true;
},
});