Integrations: Fix terms consent display when they are required

(cherry picked from commit 394aedbf5f)
This commit is contained in:
manuroe 2019-11-15 16:39:27 +01:00
parent 2b506d68f3
commit 9a58cbccde
2 changed files with 20 additions and 17 deletions

View file

@ -1,3 +1,9 @@
Changes in 0.10.2 (2019-11-15)
===============================================
Bug fix:
* Integrations: Fix terms consent display when they are required.
Changes in 0.10.1 (2019-11-06) Changes in 0.10.1 (2019-11-06)
=============================================== ===============================================

View file

@ -619,28 +619,25 @@ NSString *const WidgetManagerErrorDomain = @"WidgetManagerErrorDomain";
NSLog(@"[WidgetManager] validateScalarToken. Error in modular/account request. statusCode: %@", @(urlResponse.statusCode)); NSLog(@"[WidgetManager] validateScalarToken. Error in modular/account request. statusCode: %@", @(urlResponse.statusCode));
if (urlResponse && urlResponse.statusCode / 100 != 2) MXError *mxError = [[MXError alloc] initWithNSError:error];
if ([mxError.errcode isEqualToString:kMXErrCodeStringTermsNotSigned])
{
NSLog(@"[WidgetManager] validateScalarToke. Error: Need to accept terms");
NSError *termsNotSignedError = [NSError errorWithDomain:WidgetManagerErrorDomain
code:WidgetManagerErrorCodeTermsNotSigned
userInfo:@{
NSLocalizedDescriptionKey:error.userInfo[NSLocalizedDescriptionKey]
}];
failure(termsNotSignedError);
}
else if (urlResponse && urlResponse.statusCode / 100 != 2)
{ {
complete(NO); complete(NO);
} }
else if (failure) else if (failure)
{ {
MXError *mxError = [[MXError alloc] initWithNSError:error]; failure(error);
if ([mxError.errcode isEqualToString:kMXErrCodeStringTermsNotSigned])
{
NSLog(@"[WidgetManager] validateScalarToke. Error: Need to accept terms");
NSError *termsNotSignedError = [NSError errorWithDomain:WidgetManagerErrorDomain
code:WidgetManagerErrorCodeTermsNotSigned
userInfo:@{
NSLocalizedDescriptionKey:error.userInfo[NSLocalizedDescriptionKey]
}];
failure(termsNotSignedError);
}
else
{
failure(error);
}
} }
}]; }];
} }