File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
Modules/Presentation/Features/Accounts/Sources/Accounts/Ads/ViewModel Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -29,11 +29,6 @@ final public class AdsSlotViewModel: ObservableObject {
2929 self . appEnvironmentUseCase = appEnvironmentUseCase
3030 }
3131
32- deinit {
33- monitorAdsSlotChangesTask? . cancel ( )
34- monitorAdsSlotChangesTask = nil
35- }
36-
3732 // MARK: Setup
3833 func setupSubscriptions( ) {
3934 NotificationCenter . default
@@ -64,11 +59,9 @@ final public class AdsSlotViewModel: ObservableObject {
6459
6560 // MARK: Ads Slot changes
6661 func monitorAdsSlotChanges( ) {
67- monitorAdsSlotChangesTask = Task { [ weak self] in
68- guard let self else { return }
62+ monitorAdsSlotChangesTask = Task { [ weak self, adsSlotChangeStream] in
6963 for await newAdsSlotConfig in adsSlotChangeStream. adsSlotStream {
70- if Task . isCancelled { return }
71- await updateAdsSlot ( newAdsSlotConfig)
64+ await self ? . updateAdsSlot ( newAdsSlotConfig)
7265 }
7366 }
7467 }
You can’t perform that action at this time.
0 commit comments