mirror of
https://github.com/flarum/core.git
synced 2025-08-08 01:16:52 +02:00
fix(tags): tag selection modal shown when no tags can be selected (#3448)
This commit is contained in:
@@ -65,10 +65,15 @@ export default function () {
|
|||||||
const chosenSecondaryTags = chosenTags.filter((tag) => tag.position() === null);
|
const chosenSecondaryTags = chosenTags.filter((tag) => tag.position() === null);
|
||||||
const selectableTags = getSelectableTags();
|
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 (
|
if (
|
||||||
(!chosenTags.length ||
|
((!chosenTags.length && maxPrimaryTags !== 0 && maxSecondaryTags !== 0) ||
|
||||||
chosenPrimaryTags.length < app.forum.attribute('minPrimaryTags') ||
|
chosenPrimaryTags.length < minPrimaryTags ||
|
||||||
chosenSecondaryTags.length < app.forum.attribute('minSecondaryTags')) &&
|
chosenSecondaryTags.length < minSecondaryTags) &&
|
||||||
selectableTags.length
|
selectableTags.length
|
||||||
) {
|
) {
|
||||||
app.modal.show(TagDiscussionModal, {
|
app.modal.show(TagDiscussionModal, {
|
||||||
|
Reference in New Issue
Block a user