mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Load room details on appearance. Avoid overwhelming the rust runtime and slow down the room timeline loading.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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() ?? ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user