     }
 
     func viewUserDidTap(sender: Any) {
+        textFieldSearch.resignFirstResponder()
+
         if let _ = viewUserMenu {
             dismissUserMenu()
         } else {

        guard let auth = AuthManager.isAuthenticated() else { return }
        subscriptions = auth.subscriptions.sorted(byProperty: "lastSeen", ascending: false)
        groupSubscription()
        tableView?.reloadData()

        // Update current user data
        Realm.execute { (realm) in
            guard let labelUsername = self.labelUsername else { return }
            guard let viewUserStatus = self.viewUserStatus else { return }

            if let user = realm.object(ofType: User.self, forPrimaryKey: auth.userId) {
                labelUsername.text = user.username ?? ""



    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        updateCurrentUserInformation()
        ChatViewController.sharedInstance()?.toggleStatusBar(hide: true)
    }

