@ -5,7 +5,7 @@ final class OnboardingPublicKeyViewController : OnboardingBaseViewController {
private var keyPair : ECKeyPair ! { didSet { updateMnemonic ( ) } }
private var keyPair : ECKeyPair ! { didSet { updateMnemonic ( ) } }
private var hexEncodedPublicKey : String !
private var hexEncodedPublicKey : String !
private var mnemonic : String ! { didSet { mnemonicLabel . text = mnemonic } }
private var mnemonic : String ! { didSet { mnemonicLabel . text = mnemonic } }
private var profile Name: String ?
private var user Name: String ?
private lazy var mnemonicLabel : UILabel = {
private lazy var mnemonicLabel : UILabel = {
let result = createExplanationLabel ( text : " " )
let result = createExplanationLabel ( text : " " )
@ -17,10 +17,9 @@ final class OnboardingPublicKeyViewController : OnboardingBaseViewController {
return result
return result
} ( )
} ( )
@objc
init ( onboardingController : OnboardingController , userName : String ? ) {
public init ( onboardingController : OnboardingController , profileName : String ? ) {
super . init ( onboardingController : onboardingController )
super . init ( onboardingController : onboardingController ) ;
self . userName = userName
self . profileName = profileName
}
}
override public func viewDidLoad ( ) {
override public func viewDidLoad ( ) {
@ -81,10 +80,10 @@ final class OnboardingPublicKeyViewController : OnboardingBaseViewController {
strongSelf . onboardingController . verificationDidComplete ( fromView : strongSelf )
strongSelf . onboardingController . verificationDidComplete ( fromView : strongSelf )
}
}
if let name = self . profile Name {
if let userName = user Name {
// T r y s a v e t h e p r o f i l e n a m e
// T r y s a v e t h e p r o f i l e n a m e
OWSProfileManager . shared ( ) . updateLocalProfileName ( n ame, avatarImage : nil , success : verificationComplete , failure : {
OWSProfileManager . shared ( ) . updateLocalProfileName ( userN ame, avatarImage : nil , success : verificationComplete , failure : {
Logger . warn ( " Failed to set profile name" )
Logger . warn ( " Failed to set user name" )
verificationComplete ( )
verificationComplete ( )
} )
} )
} else {
} else {