mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Auto dismiss bug report when completed (#83)
* #76 Show success indicator on settings coordinator when bug report completed * #76 Add changelog * #76 remove unused method * #76 Rename `errorIndicator`s to `statusIndicator`s
This commit is contained in:
@@ -33,7 +33,7 @@ final class BugReportCoordinator: Coordinator, Presentable {
|
||||
|
||||
private var indicatorPresenter: UserIndicatorTypePresenterProtocol
|
||||
private var loadingIndicator: UserIndicator?
|
||||
private var errorIndicator: UserIndicator?
|
||||
private var statusIndicator: UserIndicator?
|
||||
|
||||
// MARK: Public
|
||||
|
||||
@@ -67,12 +67,10 @@ final class BugReportCoordinator: Coordinator, Presentable {
|
||||
self.startLoading()
|
||||
case .submitFinished:
|
||||
self.stopLoading()
|
||||
self.showSuccess(label: ElementL10n.done)
|
||||
self.completion?()
|
||||
case .submitFailed(let error):
|
||||
self.stopLoading()
|
||||
self.showError(label: error.localizedDescription)
|
||||
case .cancel:
|
||||
self.completion?()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -97,13 +95,8 @@ final class BugReportCoordinator: Coordinator, Presentable {
|
||||
loadingIndicator = nil
|
||||
}
|
||||
|
||||
/// Show success indicator
|
||||
private func showSuccess(label: String) {
|
||||
errorIndicator = indicatorPresenter.present(.success(label: label))
|
||||
}
|
||||
|
||||
/// Show error indicator
|
||||
private func showError(label: String) {
|
||||
errorIndicator = indicatorPresenter.present(.error(label: label))
|
||||
statusIndicator = indicatorPresenter.present(.error(label: label))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ enum BugReportViewModelAction {
|
||||
case submitStarted
|
||||
case submitFinished
|
||||
case submitFailed(error: Error)
|
||||
case cancel
|
||||
}
|
||||
|
||||
// MARK: View
|
||||
@@ -42,7 +41,6 @@ struct BugReportViewStateBindings {
|
||||
|
||||
enum BugReportViewAction {
|
||||
case submit
|
||||
case cancel
|
||||
case toggleSendLogs
|
||||
case removeScreenshot
|
||||
}
|
||||
|
||||
@@ -76,8 +76,6 @@ class BugReportViewModel: BugReportViewModelType, BugReportViewModelProtocol {
|
||||
switch viewAction {
|
||||
case .submit:
|
||||
await submitBugReport()
|
||||
case .cancel:
|
||||
callback?(.cancel)
|
||||
case .toggleSendLogs:
|
||||
context.sendingLogsEnabled.toggle()
|
||||
case .removeScreenshot:
|
||||
|
||||
Reference in New Issue
Block a user