Dont show empty categories in viewer list.

This commit is contained in:
23rd 2018-09-19 13:15:59 +03:00 committed by pajlada
parent 6a9252ac12
commit acd03a3280

View file

@ -485,9 +485,12 @@ void Split::showViewerList()
loadingLabel->hide(); loadingLabel->hide();
for (int i = 0; i < jsonLabels.size(); i++) { for (int i = 0; i < jsonLabels.size(); i++) {
auto currentCategory = chattersObj.value(jsonLabels.at(i)).toArray();
// If current category of chatters is empty, dont show this category.
if (currentCategory.size() == 0) continue;
chattersList->addItem(labelList.at(i)); chattersList->addItem(labelList.at(i));
foreach (const QJsonValue &v, foreach (const QJsonValue &v, currentCategory)
chattersObj.value(jsonLabels.at(i)).toArray())
chattersList->addItem(v.toString()); chattersList->addItem(v.toString());
} }