mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
Integrations: Fix terms consent display when they are required
(cherry picked from commit 394aedbf5f
)
This commit is contained in:
parent
2b506d68f3
commit
9a58cbccde
2 changed files with 20 additions and 17 deletions
|
@ -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)
|
||||||
===============================================
|
===============================================
|
||||||
|
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue