Merge branch 'develop' into feature/tabbar_animation

This commit is contained in:
Michael Chen 2018-07-19 09:56:58 -04:00
commit 38601c6166
4 changed files with 17 additions and 3 deletions

View File

@ -33,6 +33,7 @@ typedef void (^TextFieldErrorHandler)(NSArray * _Nonnull fieldErrors);
@property (nonatomic) BOOL isGreedy;
@property (nonatomic) UIAlertControllerStyle alertStyle;
@property (nonatomic) MFAlertType type;
@property (nonatomic) BOOL defaultAction;
@property (nonnull, strong, nonatomic) NSArray *fieldErrors;
@property (nullable, nonatomic, copy) TextFieldErrorHandler textFieldErrorHandler;

View File

@ -39,6 +39,7 @@
// only if actions are empty, then go inside and set OK as default action
if (alert.type == MFAlertTypePopup && alert.actions.count == 0) {
alert.defaultAction = YES;
alert.actions = @[[UIAlertAction actionWithTitle:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedOK] style:UIAlertActionStyleDefault handler:nil]];
}
return alert;
@ -119,6 +120,7 @@
self.title = error.title;
self.message = [NSString stringWithFormat:@"%@ (%@)",error.messageToDisplay,[error stringErrorCode]];
self.actions = @[[UIAlertAction actionWithTitle:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedOK] style:UIAlertActionStyleDefault handler:nil]];
self.defaultAction = YES;
self.isGreedy = isGreedy;
self.type = MFAlertTypePopup;
self.alertStyle = UIAlertControllerStyleAlert;

View File

@ -38,5 +38,6 @@ typedef NS_ENUM(NSInteger, ErrorCode) {
ErrorCodeInvalidSettingType,
ErrorCodeServerFailSendFaceIDHash,
ErrorCodeSSL,
ErrorCodeNoViewControllerToPresentOn
ErrorCodeNoViewControllerToPresentOn,
ErrorCodeNoErrorPageSent
};

View File

@ -480,10 +480,20 @@
return;
}
// Check if we should load a screen.
if (loadObject.operation.backgroundLoad || (!error.errorScreenError && loadObject.requestParameters.noViewControllerToLoad) || (!error.nativeDrivenErrorScreen && loadObject.pageType.length == 0)) {
// No screen to load, finish the load.
[MVMCoreLoadRequestOperation loadFinished:loadObject loadedViewController:nil errorObject:error];
// If the server told us there is an error screen but did not provide the page, show a critical error and log so we can have them fix it.
if (error.errorScreenError && !error.nativeDrivenErrorScreen && loadObject.pageType.length == 0) {
error.logError = YES;
error.errorScreenError = NO;
error.location = [NSString stringWithFormat:@"%li-%@",(long)ErrorCodeNoErrorPageSent,error.location];
[MVMCoreLoadRequestOperation handleError:error loadObject:loadObject showAlertForErrorIfApplicable:YES];
[MVMCoreLoadRequestOperation loadFinished:loadObject loadedViewController:nil errorObject:error];
} else {
// No screen to load, finish the load.
[MVMCoreLoadRequestOperation loadFinished:loadObject loadedViewController:nil errorObject:error];
}
} else {
// We have a screen to show.