Skip to content
Snippets Groups Projects
Commit d69ab594 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk
Browse files

fix: link account

When linking device to an account show error message if pin or
password are incorrect.

Change-Id: I2cce4b51a45979bcc6d8843ae0bd1978d393ec38
parent cb5f62ab
No related branches found
No related tags found
No related merge requests found
......@@ -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 : @"");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment