mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: add check for no tids
This commit is contained in:
@@ -119,6 +119,9 @@ define('forum/category/tools', [
|
|||||||
|
|
||||||
components.get('topic/tag').on('click', async function () {
|
components.get('topic/tag').on('click', async function () {
|
||||||
const tids = topicSelect.getSelectedTids();
|
const tids = topicSelect.getSelectedTids();
|
||||||
|
if (!tids.length) {
|
||||||
|
return alerts.error('[[error:no-topics-selected]]');
|
||||||
|
}
|
||||||
const topics = await Promise.all(tids.map(tid => api.get(`/topics/${tid}`)));
|
const topics = await Promise.all(tids.map(tid => api.get(`/topics/${tid}`)));
|
||||||
require(['forum/topic/tag'], function (tag) {
|
require(['forum/topic/tag'], function (tag) {
|
||||||
tag.init(topics, ajaxify.data.tagWhitelist, onCommandComplete);
|
tag.init(topics, ajaxify.data.tagWhitelist, onCommandComplete);
|
||||||
|
|||||||
Reference in New Issue
Block a user