mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
Fix UI status at record startup and depending on the recording status
This commit is contained in:
parent
62b4e822ff
commit
eedfc637e9
2 changed files with 4 additions and 3 deletions
|
@ -37,13 +37,13 @@ struct VoiceBroadcastRecorderView: View {
|
|||
|
||||
HStack(alignment: .top, spacing: 16.0) {
|
||||
Button {
|
||||
if viewModel.viewState.recordingState == .started {
|
||||
if viewModel.viewState.recordingState != .stopped {
|
||||
viewModel.send(viewAction: .stop)
|
||||
} else {
|
||||
viewModel.send(viewAction: .start)
|
||||
}
|
||||
} label: {
|
||||
if viewModel.viewState.recordingState == .started {
|
||||
if viewModel.viewState.recordingState != .stopped {
|
||||
Image("voice_broadcast_stop")
|
||||
.renderingMode(.original)
|
||||
} else {
|
||||
|
@ -56,7 +56,7 @@ struct VoiceBroadcastRecorderView: View {
|
|||
Button {
|
||||
if viewModel.viewState.recordingState == .paused {
|
||||
viewModel.send(viewAction: .resume)
|
||||
} else if viewModel.viewState.recordingState == .started {
|
||||
} else {
|
||||
viewModel.send(viewAction: .pause)
|
||||
}
|
||||
} label: {
|
||||
|
|
|
@ -37,6 +37,7 @@ class VoiceBroadcastRecorderViewModel: VoiceBroadcastRecorderViewModelType, Voic
|
|||
super.init(initialViewState: VoiceBroadcastRecorderViewState(details: details,
|
||||
recordingState: .stopped,
|
||||
bindings: VoiceBroadcastRecorderViewStateBindings()))
|
||||
process(viewAction: .start)
|
||||
}
|
||||
|
||||
// MARK: - Public
|
||||
|
|
Loading…
Reference in a new issue