Make Chat show spinner until ready
Like EditAccount, instead of crashing if the room isn't loaded yet.
This commit is contained in:
@@ -9,4 +9,24 @@ HListModel {
|
||||
sorters: StringSorter {
|
||||
roleName: "displayName"
|
||||
}
|
||||
|
||||
readonly property ListModel _emptyModel: ListModel {}
|
||||
|
||||
function find(userId, category, roomId) {
|
||||
if (! userId) { return }
|
||||
|
||||
let found = rooms.getWhere({userId, roomId, category}, 1)[0]
|
||||
if (found) { return found }
|
||||
|
||||
return {
|
||||
userId, category, roomId,
|
||||
displayName: "",
|
||||
avatarUrl: "",
|
||||
topic: "",
|
||||
members: _emptyModel,
|
||||
typingText: "",
|
||||
inviterId: "",
|
||||
loading: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -11,8 +11,8 @@ HListModel {
|
||||
// the expression with invalid data to establish property bindings
|
||||
if (! userId) { return }
|
||||
|
||||
let found = getWhere({userId}, 1)
|
||||
if (found.length > 0) { return found[0] }
|
||||
let found = getWhere({userId}, 1)[0]
|
||||
if (found) { return found }
|
||||
|
||||
py.callCoro("request_user_update_event", [userId])
|
||||
|
||||
|
Reference in New Issue
Block a user