Fix banners not live-updating

This commit is contained in:
miruka 2019-04-21 15:34:08 -04:00
parent ea8f75c729
commit 4dced63b63
3 changed files with 6 additions and 5 deletions

View File

@ -71,14 +71,16 @@ class Room(ListItem):
displayNameChanged = pyqtSignal("QVariant") displayNameChanged = pyqtSignal("QVariant")
topicChanged = pyqtSignal(str) topicChanged = pyqtSignal(str)
typingUsersChanged = pyqtSignal("QVariantList") typingUsersChanged = pyqtSignal("QVariantList")
inviterChanged = pyqtSignal("QVariant")
leftEventChanged = pyqtSignal("QVariant")
roomId = prop(str, "roomId") roomId = prop(str, "roomId")
category = prop(str, "category") category = prop(str, "category", categoryChanged)
displayName = prop(str, "displayName", displayNameChanged) displayName = prop(str, "displayName", displayNameChanged)
topic = prop(str, "topic", topicChanged, "") topic = prop(str, "topic", topicChanged, "")
typingUsers = prop(list, "typingUsers", typingUsersChanged, []) typingUsers = prop(list, "typingUsers", typingUsersChanged, [])
inviter = prop("QVariant", "inviter") inviter = prop("QVariant", "inviter", inviterChanged)
leftEvent = prop("QVariant", "leftEvent") leftEvent = prop("QVariant", "leftEvent", leftEventChanged)
class RoomEvent(ListItem): class RoomEvent(ListItem):

View File

@ -9,6 +9,7 @@ ColumnLayout {
readonly property var roomInfo: readonly property var roomInfo:
Backend.models.rooms.get(userId).getWhere("roomId", roomId) Backend.models.rooms.get(userId).getWhere("roomId", roomId)
id: chatPage id: chatPage
spacing: 0 spacing: 0
onFocusChanged: sendBox.setFocus() onFocusChanged: sendBox.setFocus()

View File

@ -156,8 +156,6 @@ function getLeftBannerText(leftEvent) {
return "You are not member of this room." return "You are not member of this room."
} }
console.log(JSON.stringify(leftEvent, null, 4))
var info = leftEvent.content var info = leftEvent.content
var prev = leftEvent.prev_content var prev = leftEvent.prev_content
var reason = info.reason ? (" Reason: " + info.reason) : "" var reason = info.reason ? (" Reason: " + info.reason) : ""