         NotificationCenter.default.addObserver(self, selector: #selector(presentUserLoginControll(notification:)), name: .oAuthDidFail, object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(presentUserLoginControll(notification:)), name: .oAuthNeedsUserLogin, object: nil)
         
+        NotificationCenter.default.addObserver(self, selector: #selector(updateDataSource), name: .tokenDidAuthorize, object: nil)
+        
         //notifications for user actions
         NotificationCenter.default.addObserver(self, selector: #selector(didTapImageButton(notification:)), name: .didTapImageButton, object: nil)
  

    }
    
    @objc func updateDataSource(){
        
        if (Authorization.sharedInstance.token.allKeys.count>0){
            self.refresher.beginRefreshing()
            Post.fetch()
        }

    }

    
    override func viewDidAppear(_ animated: Bool) {
        self.updateCellSize()
        updateDataSource()
    
    }
