Selaa lähdekoodia

suppress duplicate @Published emissions

Jonas Björkert 1 vuosi sitten
vanhempi
commit
68d610456f
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      LoopFollow/Remote/RemoteViewController.swift

+ 2 - 2
LoopFollow/Remote/RemoteViewController.swift

@@ -16,8 +16,8 @@ class RemoteViewController: UIViewController {
         super.viewDidLoad()
         super.viewDidLoad()
 
 
         cancellable = Publishers.CombineLatest(
         cancellable = Publishers.CombineLatest(
-            Storage.shared.remoteType.$value,
-            Storage.shared.device.$value
+            Storage.shared.remoteType.$value.removeDuplicates(),
+            Storage.shared.device.$value.removeDuplicates()
         )
         )
         .sink { [weak self] _, _ in
         .sink { [weak self] _, _ in
             DispatchQueue.main.async {
             DispatchQueue.main.async {