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>) {
|
private func startLoading(label: String = L10n.commonLoading, progressPublisher: CurrentValuePublisher<Double, Never>) {
|
||||||
parameters.userIndicatorController?.submitIndicator(
|
parameters.userIndicatorController?.submitIndicator(
|
||||||
UserIndicator(id: Self.loadingIndicatorIdentifier,
|
UserIndicator(id: Self.loadingIndicatorIdentifier,
|
||||||
type: .modal(progress: .published(progressPublisher), interactiveDismissDisabled: false, allowsInteraction: false),
|
type: .modal(progress: .published(progressPublisher), interactiveDismissDisabled: false, allowsInteraction: true),
|
||||||
title: label,
|
title: label,
|
||||||
persistent: true)
|
persistent: true)
|
||||||
)
|
)
|
||||||
|
@ -28,6 +28,7 @@ struct BugReportScreenViewState: BindableState {
|
|||||||
var screenshot: UIImage?
|
var screenshot: UIImage?
|
||||||
var bindings: BugReportScreenViewStateBindings
|
var bindings: BugReportScreenViewStateBindings
|
||||||
let isModallyPresented: Bool
|
let isModallyPresented: Bool
|
||||||
|
var shouldDisableInteraction = false
|
||||||
}
|
}
|
||||||
|
|
||||||
struct BugReportScreenViewStateBindings {
|
struct BugReportScreenViewStateBindings {
|
||||||
|
@ -24,6 +24,7 @@ class BugReportScreenViewModel: BugReportScreenViewModelType, BugReportScreenVie
|
|||||||
private let userID: String
|
private let userID: String
|
||||||
private let deviceID: String?
|
private let deviceID: String?
|
||||||
private let actionsSubject: PassthroughSubject<BugReportScreenViewModelAction, Never> = .init()
|
private let actionsSubject: PassthroughSubject<BugReportScreenViewModelAction, Never> = .init()
|
||||||
|
@CancellableTask private var uploadTask: Task<Void, Never>?
|
||||||
|
|
||||||
var actions: AnyPublisher<BugReportScreenViewModelAction, Never> {
|
var actions: AnyPublisher<BugReportScreenViewModelAction, Never> {
|
||||||
actionsSubject.eraseToAnyPublisher()
|
actionsSubject.eraseToAnyPublisher()
|
||||||
@ -49,9 +50,11 @@ class BugReportScreenViewModel: BugReportScreenViewModelType, BugReportScreenVie
|
|||||||
override func process(viewAction: BugReportScreenViewAction) {
|
override func process(viewAction: BugReportScreenViewAction) {
|
||||||
switch viewAction {
|
switch viewAction {
|
||||||
case .cancel:
|
case .cancel:
|
||||||
|
uploadTask = nil
|
||||||
actionsSubject.send(.cancel)
|
actionsSubject.send(.cancel)
|
||||||
case .submit:
|
case .submit:
|
||||||
Task { await submitBugReport() }
|
state.shouldDisableInteraction = true
|
||||||
|
uploadTask = Task { await submitBugReport() }
|
||||||
case .removeScreenshot:
|
case .removeScreenshot:
|
||||||
state.screenshot = nil
|
state.screenshot = nil
|
||||||
case let .attachScreenshot(image):
|
case let .attachScreenshot(image):
|
||||||
|
@ -32,6 +32,7 @@ struct BugReportScreen: View {
|
|||||||
sendLogsSection
|
sendLogsSection
|
||||||
canContactSection
|
canContactSection
|
||||||
}
|
}
|
||||||
|
.disabled(context.viewState.shouldDisableInteraction)
|
||||||
.scrollDismissesKeyboard(.immediately)
|
.scrollDismissesKeyboard(.immediately)
|
||||||
.compoundList()
|
.compoundList()
|
||||||
.navigationTitle(L10n.commonReportABug)
|
.navigationTitle(L10n.commonReportABug)
|
||||||
@ -131,6 +132,7 @@ struct BugReportScreen: View {
|
|||||||
context.send(viewAction: .submit)
|
context.send(viewAction: .submit)
|
||||||
}
|
}
|
||||||
.disabled(context.reportText.count < 5)
|
.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