File tree 1 file changed +6
-0
lines changed
Modules/Presentation/Features/Accounts/Sources/Accounts/Ads/ViewModel
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ final public class AdsSlotViewModel: ObservableObject {
29
29
self . appEnvironmentUseCase = appEnvironmentUseCase
30
30
}
31
31
32
+ deinit {
33
+ monitorAdsSlotChangesTask? . cancel ( )
34
+ monitorAdsSlotChangesTask = nil
35
+ }
36
+
32
37
// MARK: Setup
33
38
func setupSubscriptions( ) {
34
39
NotificationCenter . default
@@ -59,6 +64,7 @@ final public class AdsSlotViewModel: ObservableObject {
59
64
60
65
// MARK: Ads Slot changes
61
66
func monitorAdsSlotChanges( ) {
67
+ monitorAdsSlotChangesTask? . cancel ( )
62
68
monitorAdsSlotChangesTask = Task { [ weak self, adsSlotChangeStream] in
63
69
for await newAdsSlotConfig in adsSlotChangeStream. adsSlotStream {
64
70
await self ? . updateAdsSlot ( newAdsSlotConfig)
You can’t perform that action at this time.
0 commit comments