             }
             profileTags.text = tagText
             
-            currentUser!.getParticipatingEvents(userEventType: .Upcoming) { (upcomingEvents) in
-                self.events.append(upcomingEvents)
-                self.tableView.reloadData()
-            }
-
-            currentUser!.getParticipatingEvents(userEventType: .Past) { (pastEvents) in
-                self.events.append(pastEvents)
-                self.tableView.reloadData()
-            }
+            updateEventsForCurrentUser()
         }
     }
     

        // Pass the selected object to the new view controller.
    }


}


    func onUnregister() {
        self.events = []
        updateEventsForCurrentUser()
    }

    // MARK: - Navigation
