mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Group together voice message and poll actions (#2054)
* Group together voice message and poll actions * Extract nested switches into separate methods
This commit is contained in:
+4
-4
@@ -40,22 +40,22 @@ struct VoiceMessageRoomTimelineView: View {
|
||||
}
|
||||
|
||||
private func onPlaybackPlayPause() {
|
||||
context.send(viewAction: .playPauseAudio(itemID: timelineItem.id))
|
||||
context.send(viewAction: .audio(.playPause(itemID: timelineItem.id)))
|
||||
}
|
||||
|
||||
private func onPlaybackSeek(_ progress: Double) {
|
||||
context.send(viewAction: .seekAudio(itemID: timelineItem.id, progress: progress))
|
||||
context.send(viewAction: .audio(.seek(itemID: timelineItem.id, progress: progress)))
|
||||
}
|
||||
|
||||
private func onPlaybackScrubbing(_ dragging: Bool) {
|
||||
if dragging {
|
||||
if playerState.playbackState == .playing {
|
||||
resumePlaybackAfterScrubbing = true
|
||||
context.send(viewAction: .playPauseAudio(itemID: timelineItem.id))
|
||||
context.send(viewAction: .audio(.playPause(itemID: timelineItem.id)))
|
||||
}
|
||||
} else {
|
||||
if resumePlaybackAfterScrubbing {
|
||||
context.send(viewAction: .playPauseAudio(itemID: timelineItem.id))
|
||||
context.send(viewAction: .audio(.playPause(itemID: timelineItem.id)))
|
||||
resumePlaybackAfterScrubbing = false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user