fix: add check for no tids

isekai-main
Barış Soner Uşaklı 2 years ago
parent 291c2e1cb7
commit 156b8e7721

@ -119,6 +119,9 @@ define('forum/category/tools', [
components.get('topic/tag').on('click', async function () {
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}`)));
require(['forum/topic/tag'], function (tag) {
tag.init(topics, ajaxify.data.tagWhitelist, onCommandComplete);

Loading…
Cancel
Save