Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Sahara/Feature/CardInfo/CardInfoViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ final class CardInfoViewModel: BaseViewModelProtocol {
let ocrObservable = ocrManager.recognizeText(from: editedImage)

return Observable.zip(imageDataObservable, ocrObservable)
.observe(on: MainScheduler.instance)
.flatMap { [weak self] imageData, ocrText -> Observable<Void> in
guard let self = self else { return .empty() }

Expand Down Expand Up @@ -546,6 +547,7 @@ final class CardInfoViewModel: BaseViewModelProtocol {
let ocrObservable = imageChanged ? ocrManager.recognizeText(from: editedImage) : Observable.just(card.ocrText)

return Observable.zip(imageDataObservable, ocrObservable)
.observe(on: MainScheduler.instance)
.flatMap { [weak self] imageData, ocrText -> Observable<Void> in
guard let self = self else { return .empty() }

Expand All @@ -559,7 +561,6 @@ final class CardInfoViewModel: BaseViewModelProtocol {
location: location,
isLocked: isLocked
)
.observe(on: MainScheduler.instance)
.do(onNext: {
self.logUpdateAnalytics(editTypes: editTypes, hadLocationBefore: analyticsCtx.hadLocationBefore, location: location)
})
Expand Down Expand Up @@ -623,6 +624,7 @@ final class CardInfoViewModel: BaseViewModelProtocol {
let ocrObservable = imageChanged ? ocrManager.recognizeText(from: editedImage) : Observable.just(card.ocrText)

return Observable.zip(imageDataObservable, ocrObservable)
.observe(on: MainScheduler.instance)
.flatMap { [weak self] imageData, ocrText -> Observable<Void> in
guard let self = self else { return .empty() }

Expand All @@ -636,7 +638,6 @@ final class CardInfoViewModel: BaseViewModelProtocol {
location: location,
isLocked: isLocked
)
.observe(on: MainScheduler.instance)
.do(onNext: {
self.logUpdateAnalytics(editTypes: editTypes, hadLocationBefore: analyticsCtx.hadLocationBefore, location: location)
})
Expand Down