From c93fe59b5c71d7d83cce09a38acfa89ca33af772 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Thu, 28 Sep 2023 09:26:17 -0400 Subject: [PATCH] improvement to hardcoded debugging functions --- .../MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m | 10 ++++++---- .../MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index 45127b5..4ec531f 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -297,10 +297,12 @@ } #if ENABLE_HARD_CODED_RESPONSE - if ([[MVMCoreObject sharedInstance].globalLoadDelegate respondsToSelector:@selector(getJSONForPageType:)]) { - NSDictionary *json = [[MVMCoreObject sharedInstance].globalLoadDelegate getJSONForPageType:requestParameters.pageType]; - completionHandler(json); - return; + if ([[MVMCoreObject sharedInstance].globalLoadDelegate respondsToSelector:@selector(getJSONForRequestParameters:)]) { + NSDictionary *json = [[MVMCoreObject sharedInstance].globalLoadDelegate getJSONForRequestParameters:requestParameters]; + if (json) { + completionHandler(json); + return; + } } #endif diff --git a/MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h b/MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h index 938b13c..76fede6 100644 --- a/MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h +++ b/MVMCore/MVMCore/MainProtocols/MVMCoreGlobalLoadProtocol.h @@ -42,7 +42,7 @@ - (BOOL)hasContentToShow:(nonnull MVMCoreLoadObject *)loadObject error:(nullable MVMCoreErrorObject *)error; #if ENABLE_HARD_CODED_RESPONSE -- (nonnull NSDictionary *)getJSONForPageType:(nonnull NSString *)pageType; +- (nullable NSDictionary *)getJSONForRequestParameters:(nonnull MVMCoreRequestParameters *)requestParameters; - (nonnull NSDictionary *)modifyJSON:(nonnull NSDictionary *)json; #endif