Load room details on appearance. Avoid overwhelming the rust runtime and slow down the room timeline loading.

This commit is contained in:
Stefan Ceriu
2022-03-16 14:52:25 +02:00
parent 59e42ec938
commit 43f78d0a26
7 changed files with 65 additions and 29 deletions
@@ -134,6 +134,8 @@ class AuthenticationCoordinator: Coordinator {
completion(.success(()))
}
} catch {
MXLog.error("Failed logging in with error: \(error)")
DispatchQueue.main.async {
completion(.failure(.failedLoggingIn))
}
@@ -156,6 +158,8 @@ class AuthenticationCoordinator: Coordinator {
completion(.success(()))
}
} catch {
MXLog.error("Failed restoring login with error: \(error)")
DispatchQueue.main.async {
completion(.failure(.failedRestoringLogin))
}
@@ -101,6 +101,8 @@ class UserSession: ClientDelegate {
self.rooms = rooms
}
}
client.setDelegate(delegate: nil)
}
// MARK: Private
+5 -1
View File
@@ -82,6 +82,10 @@ class RoomProxy: RoomProxyProtocol, Equatable {
var lastMessage: String? {
didSet {
if lastMessage == oldValue {
return
}
callbacks.send(.updatedLastMessage)
}
}
@@ -141,7 +145,7 @@ class RoomProxy: RoomProxyProtocol, Equatable {
callback?(.success(messages))
if self.lastMessage == nil {
self.lastMessage = messages.last?.content()
self.lastMessage = messages.last?.content() ?? ""
}
}
}