@@ -6,7 +6,8 @@ import Common
66import Foundation
77import Shared
88
9- class SyncNowSetting : WithAccountSetting {
9+ class SyncNowSetting : WithAccountSetting ,
10+ Notifiable {
1011 private weak var settingsDelegate : AccountSettingsDelegate ?
1112 private var notificationCenter : NotificationProtocol
1213
@@ -27,11 +28,13 @@ class SyncNowSetting: WithAccountSetting {
2728 self . notificationCenter = notificationCenter
2829 super. init ( settings: settings)
2930
30- // FIXME: FXIOS-12995 Use Notifiable
31- notificationCenter. addObserver ( self ,
32- selector: #selector( stopRotateSyncIcon) ,
33- name: . ProfileDidFinishSyncing,
34- object: nil )
31+ startObservingNotifications (
32+ withNotificationCenter: notificationCenter,
33+ forObserver: self ,
34+ observing: [
35+ . ProfileDidFinishSyncing
36+ ]
37+ )
3538 }
3639
3740 private lazy var timestampFormatter : DateFormatter = {
@@ -70,9 +73,11 @@ class SyncNowSetting: WithAccountSetting {
7073 }
7174 }
7275
73- @objc
74- func stopRotateSyncIcon( ) {
75- DispatchQueue . main. async {
76+ // MARK: Notifiable
77+ func handleNotifications( _ notification: Notification ) {
78+ guard notification. name == . ProfileDidFinishSyncing else { return }
79+
80+ ensureMainThread {
7681 self . imageView. layer. removeAllAnimations ( )
7782 }
7883 }
0 commit comments