mirror of
https://github.com/flarum/framework.git
synced 2025-03-27 01:25:11 +08:00
fix(tags): tag selection modal shown when no tags can be selected (#3448)
This commit is contained in:
parent
3e56bd3dc6
commit
613523c9b4
@ -65,10 +65,15 @@ export default function () {
|
||||
const chosenSecondaryTags = chosenTags.filter((tag) => tag.position() === null);
|
||||
const selectableTags = getSelectableTags();
|
||||
|
||||
const minPrimaryTags = parseInt(app.forum.attribute('minPrimaryTags'));
|
||||
const minSecondaryTags = parseInt(app.forum.attribute('minSecondaryTags'));
|
||||
const maxPrimaryTags = parseInt(app.forum.attribute('maxPrimaryTags'));
|
||||
const maxSecondaryTags = parseInt(app.forum.attribute('maxSecondaryTags'));
|
||||
|
||||
if (
|
||||
(!chosenTags.length ||
|
||||
chosenPrimaryTags.length < app.forum.attribute('minPrimaryTags') ||
|
||||
chosenSecondaryTags.length < app.forum.attribute('minSecondaryTags')) &&
|
||||
((!chosenTags.length && maxPrimaryTags !== 0 && maxSecondaryTags !== 0) ||
|
||||
chosenPrimaryTags.length < minPrimaryTags ||
|
||||
chosenSecondaryTags.length < minSecondaryTags) &&
|
||||
selectableTags.length
|
||||
) {
|
||||
app.modal.show(TagDiscussionModal, {
|
||||
|
Loading…
x
Reference in New Issue
Block a user