Use the variables that are already instantiated

This commit is contained in:
Franz Liedke 2016-05-15 20:58:29 +09:00
parent 6e0f77b0e3
commit 7190cd84b4
2 changed files with 4 additions and 4 deletions

View File

@ -553,13 +553,13 @@ System.register('flarum/tags/components/TagDiscussionModal', ['flarum/components
// If the number of selected primary/secondary tags is at the maximum, then
// we'll filter out all other tags of that type.
if (primaryCount >= app.forum.attribute('maxPrimaryTags')) {
if (primaryCount >= this.maxPrimary) {
tags = tags.filter(function (tag) {
return !tag.isPrimary() || _this2.selected.indexOf(tag) !== -1;
});
}
if (secondaryCount >= app.forum.attribute('maxSecondaryTags')) {
if (secondaryCount >= this.maxSecondary) {
tags = tags.filter(function (tag) {
return tag.isPrimary() || _this2.selected.indexOf(tag) !== -1;
});

View File

@ -116,11 +116,11 @@ export default class TagDiscussionModal extends Modal {
// If the number of selected primary/secondary tags is at the maximum, then
// we'll filter out all other tags of that type.
if (primaryCount >= app.forum.attribute('maxPrimaryTags')) {
if (primaryCount >= this.maxPrimary) {
tags = tags.filter(tag => !tag.isPrimary() || this.selected.indexOf(tag) !== -1);
}
if (secondaryCount >= app.forum.attribute('maxSecondaryTags')) {
if (secondaryCount >= this.maxSecondary) {
tags = tags.filter(tag => tag.isPrimary() || this.selected.indexOf(tag) !== -1);
}