mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 21:39:12 +00:00
This commit is contained in:
parent
f3618cda9d
commit
add148b77d
@ -88,7 +88,7 @@ final class BugReportScreenCoordinator: CoordinatorProtocol {
|
||||
private func startLoading(label: String = L10n.commonLoading, progressPublisher: CurrentValuePublisher<Double, Never>) {
|
||||
parameters.userIndicatorController?.submitIndicator(
|
||||
UserIndicator(id: Self.loadingIndicatorIdentifier,
|
||||
type: .modal(progress: .published(progressPublisher), interactiveDismissDisabled: false, allowsInteraction: false),
|
||||
type: .modal(progress: .published(progressPublisher), interactiveDismissDisabled: false, allowsInteraction: true),
|
||||
title: label,
|
||||
persistent: true)
|
||||
)
|
||||
|
@ -28,6 +28,7 @@ struct BugReportScreenViewState: BindableState {
|
||||
var screenshot: UIImage?
|
||||
var bindings: BugReportScreenViewStateBindings
|
||||
let isModallyPresented: Bool
|
||||
var shouldDisableInteraction = false
|
||||
}
|
||||
|
||||
struct BugReportScreenViewStateBindings {
|
||||
|
@ -24,6 +24,7 @@ class BugReportScreenViewModel: BugReportScreenViewModelType, BugReportScreenVie
|
||||
private let userID: String
|
||||
private let deviceID: String?
|
||||
private let actionsSubject: PassthroughSubject<BugReportScreenViewModelAction, Never> = .init()
|
||||
@CancellableTask private var uploadTask: Task<Void, Never>?
|
||||
|
||||
var actions: AnyPublisher<BugReportScreenViewModelAction, Never> {
|
||||
actionsSubject.eraseToAnyPublisher()
|
||||
@ -49,9 +50,11 @@ class BugReportScreenViewModel: BugReportScreenViewModelType, BugReportScreenVie
|
||||
override func process(viewAction: BugReportScreenViewAction) {
|
||||
switch viewAction {
|
||||
case .cancel:
|
||||
uploadTask = nil
|
||||
actionsSubject.send(.cancel)
|
||||
case .submit:
|
||||
Task { await submitBugReport() }
|
||||
state.shouldDisableInteraction = true
|
||||
uploadTask = Task { await submitBugReport() }
|
||||
case .removeScreenshot:
|
||||
state.screenshot = nil
|
||||
case let .attachScreenshot(image):
|
||||
|
@ -32,6 +32,7 @@ struct BugReportScreen: View {
|
||||
sendLogsSection
|
||||
canContactSection
|
||||
}
|
||||
.disabled(context.viewState.shouldDisableInteraction)
|
||||
.scrollDismissesKeyboard(.immediately)
|
||||
.compoundList()
|
||||
.navigationTitle(L10n.commonReportABug)
|
||||
@ -131,6 +132,7 @@ struct BugReportScreen: View {
|
||||
context.send(viewAction: .submit)
|
||||
}
|
||||
.disabled(context.reportText.count < 5)
|
||||
.disabled(context.viewState.shouldDisableInteraction)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
0
changelog.d/1198.bugfix
Normal file
0
changelog.d/1198.bugfix
Normal file
Loading…
x
Reference in New Issue
Block a user