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
2427fa2dee
commit
cb07813444
|
@ -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