From d69ab594f95134d7e986a437243cc4c20ddc8f05 Mon Sep 17 00:00:00 2001 From: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com> Date: Tue, 15 Jan 2019 13:34:13 -0500 Subject: [PATCH] fix: link account When linking device to an account show error message if pin or password are incorrect. Change-Id: I2cce4b51a45979bcc6d8843ae0bd1978d393ec38 --- src/RingWizardLinkAccountVC.mm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/RingWizardLinkAccountVC.mm b/src/RingWizardLinkAccountVC.mm index 2239ba29..77f7e876 100644 --- a/src/RingWizardLinkAccountVC.mm +++ b/src/RingWizardLinkAccountVC.mm @@ -84,6 +84,8 @@ [pinTextField setStringValue:@""]; [pinTextField setEnabled:YES]; [linkButton setEnabled:NO]; + self.passwordValue = @""; + self.pinValue = @""; [passwordTextField setStringValue:@""]; } @@ -106,6 +108,9 @@ accountCreated = QObject::connect(self.accountModel, &lrc::api::NewAccountModel::accountAdded, [self] (const std::string& accountID) { + if(accountID.compare(accountToCreate) != 0) { + return; + } [self.delegate didLinkAccountWithSuccess:YES]; [self registerDefaultPreferences]; QObject::disconnect(accountCreated); @@ -119,6 +124,13 @@ [self showError]; } }); + accountRemoved = QObject::connect(self.accountModel, + &lrc::api::NewAccountModel::invalidAccountDetected, + [self] (const std::string& accountID) { + if(accountID.compare(accountToCreate) == 0) { + [self showError]; + } + }); [self showLoading]; NSString *pin = backupFile ? @"" : (self.pinValue ? self.pinValue : @""); -- GitLab