Clean & fix bad merge

pull/2/head
Niels Andriesse 7 years ago
parent 8d0c3b0f97
commit 9d64b76af6

@ -154,7 +154,7 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(avatarRowTapped:)]];
avatarRow.accessibilityIdentifier = ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"avatarRow");
// Loki - Disable setting the avatar
// Loki: Disable setting the avatar
// [rows addObject:avatarRow];
UILabel *avatarLabel = [UILabel new];

@ -42,8 +42,6 @@ final class OnboardingPublicKeyViewController : OnboardingBaseViewController {
let topSpacer = UIView.vStretchingSpacer()
let explanationLabel = createExplanationLabel(text: NSLocalizedString("Please save the seed below in a safe location. It can be used to restore your account if you lose access, or to migrate to a new device.", comment: ""))
explanationLabel.accessibilityIdentifier = "onboarding.publicKeyStep.explanationLabel"
let copyButton = createLinkButton(title: NSLocalizedString("Copy", comment: ""), selector: #selector(copyMnemonic))
copyButton.accessibilityIdentifier = "onboarding.publicKeyStep.copyButton"
let bottomSpacer = UIView.vStretchingSpacer()
let registerButton = createButton(title: NSLocalizedString("Register", comment: ""), selector: #selector(register))
registerButton.accessibilityIdentifier = "onboarding.publicKeyStep.registerButton"
@ -83,34 +81,31 @@ final class OnboardingPublicKeyViewController : OnboardingBaseViewController {
@objc private func copyMnemonic() {
UIPasteboard.general.string = mnemonic
copyButton.isUserInteractionEnabled = false
copyButton.setTitle(title: NSLocalizedString("Copied ✓", comment: ""), font: .ows_dynamicTypeBodyClamped, titleColor: .ows_materialBlue)
copyButton.setTitle(NSLocalizedString("Copied ✓", comment: ""))
Timer.scheduledTimer(timeInterval: 4, target: self, selector: #selector(enableCopyButton), userInfo: nil, repeats: false)
}
@objc private func enableCopyButton() {
copyButton.isUserInteractionEnabled = true
copyButton.setTitle(title: NSLocalizedString("Copy", comment: ""), font: .ows_dynamicTypeBodyClamped, titleColor: .ows_materialBlue)
copyButton.setTitle(NSLocalizedString("Copy", comment: ""))
}
@objc private func register() {
let accountManager = TSAccountManager.sharedInstance()
accountManager.phoneNumberAwaitingVerification = hexEncodedPublicKey
accountManager.didRegister()
let verificationComplete: () -> Void = { [weak self] in
let onSuccess: () -> Void = { [weak self] in
guard let strongSelf = self else { return }
strongSelf.onboardingController.verificationDidComplete(fromView: strongSelf)
}
if let userName = userName {
// Try save the profile name
OWSProfileManager.shared().updateLocalProfileName(userName, avatarImage: nil, success: verificationComplete, failure: {
// Try to save the user name
OWSProfileManager.shared().updateLocalProfileName(userName, avatarImage: nil, success: onSuccess, failure: {
Logger.warn("Failed to set user name")
verificationComplete()
onSuccess()
})
} else {
verificationComplete()
onSuccess()
}
}
}

@ -2550,6 +2550,7 @@
"Enter a name to be shown to your contacts" = "Enter a name to be shown to your contacts";
"Display Name (Optional)" = "Display Name (Optional)";
"Type an optional password for added security" = "Type an optional password for added security";
"Next" = "Next";
"Password (Optional)" = "Password (Optional)";
"Please save the seed below in a safe location. It can be used to restore your account if you lose access, or to migrate to a new device." = "Please save the seed below in a safe location. It can be used to restore your account if you lose access, or to migrate to a new device.";
"Copy" = "Copy";

@ -118,6 +118,11 @@ public class OWSFlatButton: UIView {
// MARK: Methods
@objc
public func setTitle(_ title: String) {
button.setTitle(title, for: .normal)
}
@objc
public func setTitle(title: String, font: UIFont,
titleColor: UIColor ) {

@ -294,7 +294,7 @@ typedef void (^ProfileManagerFailureBlock)(NSError *error);
OWSUserProfile *userProfile = self.localUserProfile;
OWSAssertDebug(userProfile);
/* LOKI - We don't support avatar uploads yet */
/* Loki: We don't support avatar uploads yet */
OWSLogVerbose(@"Updating local profile on service with no avatar.");
tryToUpdateService(nil, nil);
@ -535,10 +535,10 @@ typedef void (^ProfileManagerFailureBlock)(NSError *error);
OWSAssertDebug(successBlock);
OWSAssertDebug(failureBlock);
// Since we don't need to call any servers, automatically succeed
// Loki: We don't need to make any server calls so succeed automatically
successBlock();
/* ============ Original Code ==================
/* ============ Original Code ============
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSData *_Nullable encryptedPaddedName = [self encryptProfileNameWithUnpaddedName:localProfileName];

@ -89,9 +89,7 @@ static NSString *const RPDefaultsKeyPhoneNumberCanonical = @"RPDefaultsKeyPhoneN
}
+ (nullable PhoneNumber *)phoneNumberFromE164:(NSString *)text {
NSString *e164 = text;
PhoneNumber *result = [[PhoneNumber alloc] initWithPhoneNumber:[NBPhoneNumber new] e164:e164];
return result;
return [[PhoneNumber alloc] initWithPhoneNumber:[NBPhoneNumber new] e164:text];
// Original code:
// ========
// OWSAssertDebug(text != nil);

Loading…
Cancel
Save