Fix filter members field after switching room
This commit is contained in:
parent
5ab13e3e16
commit
1c24edb166
@ -340,6 +340,14 @@ class Client(QObject):
|
|||||||
return self.nio.room_contains_unverified(room_id)
|
return self.nio.room_contains_unverified(room_id)
|
||||||
|
|
||||||
|
|
||||||
|
@pyqtSlot(str, str, result=str)
|
||||||
|
def getMemberFilter(self, room_category: str, room_id: str) -> str:
|
||||||
|
return self.manager.backend.accounts[self.userId]\
|
||||||
|
.roomCategories[room_category]\
|
||||||
|
.rooms[room_id]\
|
||||||
|
.sortedMembers.filter
|
||||||
|
|
||||||
|
|
||||||
@pyqtSlot(str, str, str)
|
@pyqtSlot(str, str, str)
|
||||||
def setMemberFilter(self, room_category: str, room_id: str, pattern: str
|
def setMemberFilter(self, room_category: str, room_id: str, pattern: str
|
||||||
) -> None:
|
) -> None:
|
||||||
|
@ -31,6 +31,13 @@ HColumnLayout {
|
|||||||
placeholderText: qsTr("Filter members")
|
placeholderText: qsTr("Filter members")
|
||||||
backgroundColor: HStyle.sidePane.filterRooms.background
|
backgroundColor: HStyle.sidePane.filterRooms.background
|
||||||
|
|
||||||
|
// Without this, if the user types in the field, changes of room, then
|
||||||
|
// comes back, the field will be empty but the filter still applied.
|
||||||
|
Component.onCompleted:
|
||||||
|
text = Backend.clients.get(chatPage.userId).getMemberFilter(
|
||||||
|
chatPage.category, chatPage.roomId
|
||||||
|
)
|
||||||
|
|
||||||
onTextChanged: Backend.clients.get(chatPage.userId).setMemberFilter(
|
onTextChanged: Backend.clients.get(chatPage.userId).setMemberFilter(
|
||||||
chatPage.category, chatPage.roomId, text
|
chatPage.category, chatPage.roomId, text
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user