feat(StatusChatList): introduce `filterFn` and `categoryId`
Chat lists can belong to a category inside of communities, so they should hold a property `categoryId` that represents that. In addition, this commit introduces a `filterFn` function that can be used to conditionally show/hide chat list items. Closes #154
This commit is contained in:
parent
e1a94cfd84
commit
8081da7fa0
|
@ -10,9 +10,12 @@ Column {
|
|||
|
||||
spacing: 4
|
||||
|
||||
property string categoryId: ""
|
||||
property string selectedChatId: ""
|
||||
property alias chatListItems: statusChatListItems
|
||||
|
||||
property var filterFn
|
||||
|
||||
signal chatItemSelected(string id)
|
||||
signal chatItemUnmuted(string id)
|
||||
|
||||
|
@ -33,6 +36,12 @@ Column {
|
|||
|
||||
onClicked: statusChatList.chatItemSelected(model.chatId)
|
||||
onUnmute: statusChatList.chatItemUnmuted(model.chatId)
|
||||
visible: {
|
||||
if (!!statusChatList.filterFn) {
|
||||
return statusChatList.filterFn(model, statusChatList.categoryId)
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue