mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
vector-im/element-x-ios/issues/53 - Adopt MainActors, dispatch heavy operations do detached tasks and ensure combine publisher call back on the right queue
This commit is contained in:
committed by
Stefan Ceriu
parent
dde7786152
commit
f5890b68a2
@@ -67,15 +67,11 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
||||
Task {
|
||||
switch viewAction {
|
||||
case .loadPreviousPage:
|
||||
await MainActor.run {
|
||||
state.isBackPaginating = true
|
||||
}
|
||||
state.isBackPaginating = true
|
||||
|
||||
switch await timelineController.paginateBackwards(Constants.backPaginationPageSize) {
|
||||
default:
|
||||
await MainActor.run {
|
||||
state.isBackPaginating = false
|
||||
}
|
||||
state.isBackPaginating = false
|
||||
}
|
||||
|
||||
case .itemAppeared(let id):
|
||||
@@ -90,10 +86,7 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
||||
}
|
||||
|
||||
await timelineController.sendMessage(state.bindings.composerText)
|
||||
|
||||
await MainActor.run {
|
||||
state.bindings.composerText = ""
|
||||
}
|
||||
state.bindings.composerText = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user