#1246 - Prevent timeline items from being computed on the main thread when instantiating the RoomTimelineController; speed up the room selection animation.

This commit is contained in:
Stefan Ceriu
2023-09-20 13:53:34 +03:00
committed by Stefan Ceriu
parent 82981f33e9
commit 29bcc5371a
2 changed files with 4 additions and 2 deletions
@@ -169,7 +169,7 @@ struct HomeScreenRoomCellButtonStyle: ButtonStyle {
configuration.label
.background(isSelected ? Color.compound.bgSubtleSecondary : Color.compound.bgCanvasDefault)
.contentShape(Rectangle())
.animation(.elementDefault, value: isSelected)
.animation(isSelected ? .none : .easeOut(duration: 0.1), value: isSelected)
}
}
@@ -62,7 +62,9 @@ class RoomTimelineController: RoomTimelineControllerProtocol {
}
.store(in: &cancellables)
updateTimelineItems()
serialDispatchQueue.async {
self.updateTimelineItems()
}
NotificationCenter.default.addObserver(self, selector: #selector(contentSizeCategoryDidChange), name: UIContentSizeCategory.didChangeNotification, object: nil)
}