Update MVMCoreLoadRequestOperation.m

indentation and  lifted out delegate obj
This commit is contained in:
Nishanth T 2020-11-03 22:18:08 +05:30
parent ecbb9438bc
commit edfdc8576c

View File

@ -779,12 +779,11 @@
if ([loadObject.operation checkAndHandleForCancellation]) { if ([loadObject.operation checkAndHandleForCancellation]) {
return; return;
} }
DelegateObject *delegateObject = nil;
// If we have an alert to show and a loaded view controller, allow the loaded view controller to be the delegate.
DelegateObject *delegateObject = [loadedViewController respondsToSelector:@selector(delegateObject)] ? [loadedViewController delegateObject] : loadObject.operation.delegateObject;
// Show any alerts that we have been saving. // Show any alerts that we have been saving.
if (loadObject.operation.alertToShow) { if (loadObject.operation.alertToShow) {
// If we have an alert to show and a loaded view controller, allow the loaded view controller to be the delegate.
delegateObject = [loadedViewController respondsToSelector:@selector(delegateObject)] ? [loadedViewController delegateObject] : loadObject.operation.delegateObject;
[MVMCoreLoadRequestOperation createAndShowAlertForLoadObject:loadObject error:loadObject.operation.errorForAlertToShow delegateObject:delegateObject]; [MVMCoreLoadRequestOperation createAndShowAlertForLoadObject:loadObject error:loadObject.operation.errorForAlertToShow delegateObject:delegateObject];
} }
@ -796,10 +795,10 @@
} }
//make post load calls function //make post load calls function
[MVMCoreLoadRequestOperation loadPostCallActions:loadObject]; [MVMCoreLoadRequestOperation loadPostCallActions:loadObject];
[MVMCoreLoadRequestOperation loadPostAction:loadObject delegateObject:delegateObject]; [MVMCoreLoadRequestOperation loadPostAction:loadObject delegateObject:delegateObject];
[loadObject.operation markAsFinished]; [loadObject.operation markAsFinished];
} }