     
     private func setUpReachabilityObserver() {
         
-        let reachabilityObserver = defaultCenter?.addObserver(
+        let reachabilityObserver = appStateCenter.addObserver(
             forName: ReachabilityChangedNotification,
             object: self,
             queue: nil,

    import Cocoa
#endif

internal final class ConnectionObserver {
    
    private let defaultCenter: VKNotificationCenter?
    private let workspaceCenter: VKNotificationCenter?
    private let reachability: VKReachability
    
    private var appIsActive = true
    private var onConnect: (() -> ())?

    private var observers = [NSObjectProtocol?]()
    
    init(
        appStateCenter: VKNotificationCenter,
        reachabilityCenter: VKNotificationCenter,
        reachability: VKReachability,
        activeNotificationName: Notification.Name,
        inactiveNotificationName: Notification.Name,
        reachabilityNotificationName: Notification.Name
        ) {
        self.appStateCenter = appStateCenter
        self.reachabilityCenter = reachabilityCenter
        self.reachability = reachability
        self.activeNotificationName = activeNotificationName
        self.inactiveNotificationName = inactiveNotificationName
        self.reachabilityNotificationName = reachabilityNotificationName

    }
    
    public func setUp(onConnect: @escaping () -> (), onDisconnect: @escaping () -> ()) {
        self.onConnect = onConnect
        self.onDisconnect = onDisconnect
        
        setUpAppStateObservers()
        setUpReachabilityObserver()
    }
    
    private func setUpAppStateObservers() {
        let becomeActiveObserver = appStateCenter.addObserver(
            forName: activeNotificationName,
            object: self,
            queue: nil,
            using: { [weak self] notification in
