Update chatPage properly when roomCategory changes
This commit is contained in:
@@ -21,7 +21,6 @@ Banner {
|
||||
buttonCallbacks: {
|
||||
"forget": function(button) {
|
||||
button.loading = true
|
||||
chatPage.canLoadPastEvents = false
|
||||
Backend.clients.get(chatPage.userId).forgetRoom(chatPage.roomId)
|
||||
pageStack.clear()
|
||||
},
|
||||
|
@@ -14,11 +14,17 @@ HColumnLayout {
|
||||
.roomCategories.get(category)
|
||||
.rooms.get(roomId)
|
||||
|
||||
property bool canLoadPastEvents: true
|
||||
|
||||
id: chatPage
|
||||
onFocusChanged: sendBox.setFocus()
|
||||
|
||||
Component.onCompleted: Backend.signals.roomCategoryChanged.connect(
|
||||
function(forUserId, forRoomId, previous, now) {
|
||||
if (chatPage && forUserId == userId && forRoomId == roomId) {
|
||||
chatPage.category = now
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
RoomHeader {
|
||||
displayName: roomInfo.displayName
|
||||
topic: roomInfo.topic || ""
|
||||
|
@@ -2,7 +2,6 @@ import QtQuick 2.7
|
||||
import "../../Base"
|
||||
|
||||
HGlassRectangle {
|
||||
property bool canLoadPastEvents: true
|
||||
property int space: 8
|
||||
|
||||
color: HStyle.chat.roomEventList.background
|
||||
@@ -29,7 +28,7 @@ HGlassRectangle {
|
||||
property real yPos: visibleArea.yPosition
|
||||
|
||||
onYPosChanged: {
|
||||
if (chatPage.canLoadPastEvents && yPos <= 0.1) {
|
||||
if (chatPage.category != "Invites" && yPos <= 0.1) {
|
||||
Backend.loadPastEvents(chatPage.roomId)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user