mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Add support for media uploading progress
- replace the ProgressTracker with a combination of currentValueSubjects and currentValuePublishers
This commit is contained in:
committed by
Stefan Ceriu
parent
9cf2aba16d
commit
8b11a0a5ec
@@ -62,8 +62,9 @@ class BugReportScreenViewModel: BugReportScreenViewModelType, BugReportScreenVie
|
||||
// MARK: Private
|
||||
|
||||
private func submitBugReport() async {
|
||||
let progressTracker = ProgressTracker()
|
||||
actionsSubject.send(.submitStarted(progressTracker: progressTracker))
|
||||
let progressSubject = CurrentValueSubject<Double, Never>(0.0)
|
||||
|
||||
actionsSubject.send(.submitStarted(progressPublisher: progressSubject.asCurrentValuePublisher()))
|
||||
|
||||
var files: [URL] = []
|
||||
if let screenshot = context.viewState.screenshot,
|
||||
@@ -87,7 +88,7 @@ class BugReportScreenViewModel: BugReportScreenViewModelType, BugReportScreenVie
|
||||
files: files)
|
||||
|
||||
switch await bugReportService.submitBugReport(bugReport,
|
||||
progressListener: progressTracker) {
|
||||
progressListener: progressSubject) {
|
||||
case .success(let response):
|
||||
MXLog.info("Submission uploaded to: \(response.reportUrl)")
|
||||
actionsSubject.send(.submitFinished)
|
||||
|
||||
Reference in New Issue
Block a user