Fix undefined profile being requested

This commit is contained in:
miruka 2019-07-07 22:36:12 -04:00
parent fcd492ff2d
commit f64a2c68e9
3 changed files with 5 additions and 2 deletions

View File

@ -112,7 +112,7 @@ class MatrixClient(nio.AsyncClient):
async def request_user_update_event(self, user_id: str) -> None: async def request_user_update_event(self, user_id: str) -> None:
if user_id in self.backend.pending_profile_requests: if user_id in self.backend.pending_profile_requests:
return return
print(user_id) print("Requesting profile for", user_id)
self.backend.pending_profile_requests.add(user_id) self.backend.pending_profile_requests.add(user_id)
response = await self.get_profile(user_id) response = await self.get_profile(user_id)

View File

@ -72,7 +72,6 @@ function onRoomUpdated(
item item
) )
} else { } else {
print("re", replace, display_name)
rooms.set(replace, item) rooms.set(replace, item)
} }

View File

@ -4,6 +4,10 @@ import "../Base"
HListModel { HListModel {
function getUser(user_id) { function getUser(user_id) {
// Happens when SortFilterProxyModel ExpressionFilter/Sorter/Role tests
// the expression with invalid data to establish property bindings
if (! user_id) { return }
var found = getWhere({"userId": user_id}, 1) var found = getWhere({"userId": user_id}, 1)
if (found.length > 0) { return found[0] } if (found.length > 0) { return found[0] }