Ensure we mark 2fa as disabled if we delete keys, regardless of success or

failure
This commit is contained in:
Nora Trapp 2020-06-02 18:20:56 -07:00
parent a64b582798
commit 9c7d21044e

View File

@ -260,18 +260,20 @@ const NSUInteger kLegacyTruncated2FAv1PinLength = 16;
.then(^{
return [self disableRegistrationLockV2];
})
.then(
^() {
OWSAssertIsOnMainThread();
.ensure(^{
OWSAssertIsOnMainThread();
[self.databaseStorage writeWithBlock:^(SDSAnyWriteTransaction *transaction) {
[self markDisabledWithTransaction:transaction];
}];
[self.databaseStorage writeWithBlock:^(SDSAnyWriteTransaction *transaction) {
[self markDisabledWithTransaction:transaction];
}];
})
.then(^() {
OWSAssertIsOnMainThread();
if (success) {
success();
}
})
if (success) {
success();
}
})
.catch(^(NSError *error) {
OWSAssertIsOnMainThread();