From 6cc2cc25b308bfd95d78bacc4e1579418a679db6 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Mon, 25 Oct 2021 17:32:19 -0400 Subject: [PATCH] change mdn calculation default errors not received from server --- MVMCoreUI/Alerts/MVMCoreAlertObject.m | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/MVMCoreUI/Alerts/MVMCoreAlertObject.m b/MVMCoreUI/Alerts/MVMCoreAlertObject.m index 975c9540..17b7f113 100644 --- a/MVMCoreUI/Alerts/MVMCoreAlertObject.m +++ b/MVMCoreUI/Alerts/MVMCoreAlertObject.m @@ -54,8 +54,8 @@ } __block MVMCoreAlertObject *alert = [[MVMCoreAlertObject alloc] init]; - alert.title = [responseInfo stringForKey:KeyErrorHeading]; - alert.message = [responseInfo stringForKey:KeyUserMessage]; + alert.title = [responseInfo string:KeyErrorHeading] ?: [MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorTitle]; + alert.message = [responseInfo string:KeyUserMessage] ?: [MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorUnableToProcess]; NSString *messageStyle = [responseInfo stringForKey:KeyMessageStyle]; if ([ValueTypeFieldErrors isEqualToString:[responseInfo string:KeyType]]) { @@ -151,9 +151,9 @@ + (nullable instancetype)alertObjectWithPage:(nullable NSDictionary *)page isGreedy:(BOOL)isGreedy additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject error:(MVMCoreErrorObject *_Nullable *_Nullable)error { MVMCoreAlertObject *alert = [[MVMCoreAlertObject alloc] init]; - alert.title = [page stringForKey:KeyTitle]; + alert.title = [page string:KeyTitle] ?: [MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorTitle]; alert.pageJson = page; - alert.message = [page stringForKey:KeyMessage]; + alert.message = [page string:KeyMessage] ?: [MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorUnableToProcess]; alert.isGreedy = isGreedy; alert.type = MFAlertTypePopup; alert.alertStyle = UIAlertControllerStyleAlert; @@ -217,9 +217,8 @@ + (nullable instancetype)alertObjectForPageType:(nullable NSString *)pageType responseInfo:(nullable NSDictionary *)responseInfo additionalData:(nullable NSDictionary *)additionalData actionDelegate:(nullable NSObject *)actionDelegate { __block MVMCoreAlertObject *alert = [[MVMCoreAlertObject alloc] init]; - alert.title = [responseInfo stringForKey:KeyErrorHeading]; - alert.message = [responseInfo stringForKey:KeyUserMessage]; - + alert.title = [responseInfo string:KeyErrorHeading] ?: [MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorTitle]; + alert.message = [responseInfo string:KeyUserMessage] ?: [MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorUnableToProcess]; NSString *messageStyle = [responseInfo stringForKey:KeyMessageStyle]; if ([ValueTypeFieldErrors isEqualToString:[responseInfo string:KeyType]]) { @@ -279,9 +278,9 @@ + (nullable instancetype)alertObjectWithPage:(nullable NSDictionary *)page isGreedy:(BOOL)isGreedy additionalData:(nullable NSDictionary *)additionalData delegate:(nullable NSObject *)delegate error:(MVMCoreErrorObject *_Nullable *_Nullable)error { MVMCoreAlertObject *alert = [[MVMCoreAlertObject alloc] init]; - alert.title = [page stringForKey:KeyTitle]; + alert.title = [page string:KeyTitle] ?: [MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorTitle]; alert.pageJson = page; - alert.message = [page stringForKey:KeyMessage]; + alert.message = [page string:KeyMessage] ?: [MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorUnableToProcess]; alert.isGreedy = isGreedy; alert.type = MFAlertTypePopup; alert.alertStyle = UIAlertControllerStyleAlert;