mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-25 02:52:45 +02:00
Prompt the user before ending a voice broadcast
This commit is contained in:
+12
-1
@@ -23,6 +23,8 @@ struct VoiceBroadcastRecorderView: View {
|
||||
|
||||
@Environment(\.theme) private var theme: ThemeSwiftUI
|
||||
|
||||
@State private var showingStopAlert = false
|
||||
|
||||
private var backgroundColor: Color {
|
||||
if viewModel.viewState.recordingState != .paused {
|
||||
return theme.colors.alert
|
||||
@@ -97,11 +99,20 @@ struct VoiceBroadcastRecorderView: View {
|
||||
.accessibilityIdentifier("recordButton")
|
||||
|
||||
Button {
|
||||
viewModel.send(viewAction: .stop)
|
||||
showingStopAlert = true
|
||||
} label: {
|
||||
Image("voice_broadcast_stop")
|
||||
.renderingMode(.original)
|
||||
}
|
||||
.alert(isPresented:$showingStopAlert) {
|
||||
Alert(title: Text(VectorL10n.voiceBroadcastStopAlertTitle),
|
||||
message: Text(VectorL10n.voiceBroadcastStopAlertDescription),
|
||||
primaryButton: .cancel(),
|
||||
secondaryButton: .default(Text(VectorL10n.voiceBroadcastStopAlertAgreeButton),
|
||||
action: {
|
||||
viewModel.send(viewAction: .stop)
|
||||
}))
|
||||
}
|
||||
.accessibilityIdentifier("stopButton")
|
||||
.disabled(viewModel.viewState.recordingState == .stopped)
|
||||
.mask(Color.black.opacity(viewModel.viewState.recordingState == .stopped ? 0.3 : 1.0))
|
||||
|
||||
Reference in New Issue
Block a user