check all showProfile, make sure NOT set profileUser when it's self

This commit is contained in:
nixzhu
2015-05-26 11:04:40 +08:00
parent 80317bc60c
commit bf49c35759
6 changed files with 17 additions and 9 deletions
@@ -54,7 +54,9 @@ class ContactsViewController: BaseViewController {
let vc = segue.destinationViewController as! ProfileViewController
if let user = sender as? User {
vc.profileUser = ProfileUser.UserType(user)
if user.userID != YepUserDefaults.userID.value {
vc.profileUser = ProfileUser.UserType(user)
}
}
vc.hidesBottomBarWhenPushed = true
@@ -1039,9 +1039,9 @@ class ConversationViewController: BaseViewController {
let vc = segue.destinationViewController as! ProfileViewController
if let withFriend = conversation?.withFriend {
let profileUser = ProfileUser.UserType(withFriend)
vc.profileUser = profileUser
if withFriend.userID != YepUserDefaults.userID.value {
vc.profileUser = ProfileUser.UserType(withFriend)
}
vc.isFromConversation = true
vc.setBackButtonWithTitle()
@@ -95,8 +95,10 @@ class DiscoverViewController: BaseViewController {
let discoveredUser = discoveredUsers[indexPath.row]
let vc = segue.destinationViewController as! ProfileViewController
vc.profileUser = ProfileUser.DiscoveredUserType(discoveredUser)
if discoveredUser.id != YepUserDefaults.userID.value {
vc.profileUser = ProfileUser.DiscoveredUserType(discoveredUser)
}
vc.setBackButtonWithTitle()
@@ -277,8 +277,8 @@ class ProfileViewController: UIViewController {
sayHiView.hidden = true
} else {
view.bringSubviewToFront(sayHiView)
sayHiButton.setTitle(NSLocalizedString("Say Hi", comment: ""), forState: .Normal)
sayHiButton.layer.cornerRadius = 5
sayHiButton.backgroundColor = UIColor.yepTintColor()
@@ -56,7 +56,9 @@ class SearchedUsersViewController: UIViewController {
let vc = segue.destinationViewController as! ProfileViewController
vc.profileUser = ProfileUser.DiscoveredUserType(discoveredUser)
if discoveredUser.id != YepUserDefaults.userID.value {
vc.profileUser = ProfileUser.DiscoveredUserType(discoveredUser)
}
vc.setBackButtonWithTitle()
@@ -262,7 +262,9 @@ class SkillHomeViewController: CustomNavigationBarViewController {
let vc = segue.destinationViewController as! ProfileViewController
vc.profileUser = ProfileUser.DiscoveredUserType(discoveredUser)
if discoveredUser.id != YepUserDefaults.userID.value {
vc.profileUser = ProfileUser.DiscoveredUserType(discoveredUser)
}
vc.hidesBottomBarWhenPushed = true