From d85ed4c3ed95fa1f32d8e50b2746691e5d9e5e4e Mon Sep 17 00:00:00 2001
From: Richard Ramos <info@richardramos.me>
Date: Mon, 31 Jan 2022 08:54:28 -0400
Subject: [PATCH] refactor: fix empty categories handling (#544)

* feat(StatusChatListCategory): display item if the model is a category
* fix(StatusChatListAndCategories): do not display categories in StatusChatList
---
 src/StatusQ/Components/StatusChatListAndCategories.qml | 2 +-
 src/StatusQ/Components/StatusChatListCategory.qml      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/StatusQ/Components/StatusChatListAndCategories.qml b/src/StatusQ/Components/StatusChatListAndCategories.qml
index 926b497c..eb070464 100644
--- a/src/StatusQ/Components/StatusChatListAndCategories.qml
+++ b/src/StatusQ/Components/StatusChatListAndCategories.qml
@@ -76,7 +76,7 @@ Item {
                 draggableItems: statusChatListAndCategories.draggableItems
                 model: statusChatListAndCategories.model
                 filterFn: function (model) {
-                    return (model.subItems.count === 0)
+                    return !model.isCategory
                 }
                 popupMenu: statusChatListAndCategories.chatListPopupMenu
             }
diff --git a/src/StatusQ/Components/StatusChatListCategory.qml b/src/StatusQ/Components/StatusChatListCategory.qml
index eafd5596..1803b132 100644
--- a/src/StatusQ/Components/StatusChatListCategory.qml
+++ b/src/StatusQ/Components/StatusChatListCategory.qml
@@ -35,7 +35,7 @@ Column {
     StatusChatListCategoryItem {
         id: statusChatListCategoryItem
         title: statusChatListCategory.name
-        visible: (model.subItems.count > 0)
+        visible: model.isCategory
         opened: statusChatListCategory.opened
         sensor.pressAndHoldInterval: 150