From a2a858570e5b7c38355d64aa1e6fe84291a1518f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B8=88=EA=B0=80=EA=B2=BD?= Date: Tue, 10 Feb 2026 16:50:26 +0900 Subject: [PATCH] Fix realm crash --- Sahara/Feature/CardInfo/CardInfoViewModel.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sahara/Feature/CardInfo/CardInfoViewModel.swift b/Sahara/Feature/CardInfo/CardInfoViewModel.swift index 09ed897..1003533 100644 --- a/Sahara/Feature/CardInfo/CardInfoViewModel.swift +++ b/Sahara/Feature/CardInfo/CardInfoViewModel.swift @@ -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 in guard let self = self else { return .empty() } @@ -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 in guard let self = self else { return .empty() } @@ -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) }) @@ -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 in guard let self = self else { return .empty() } @@ -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) })