Recursively fetchData for requests

This commit is contained in:
Levi McCallum
2016-01-27 17:19:11 -08:00
parent ec7a3599bd
commit 585b1215a9

View File

@@ -1730,7 +1730,7 @@ static BOOL ShouldUseNewRenderingRange = YES;
- (void)setNeedsDataFetch - (void)setNeedsDataFetch
{ {
if (ASInterfaceStateIncludesFetchData(_interfaceState)) { if (ASInterfaceStateIncludesFetchData(_interfaceState)) {
[self fetchData]; [self recursivelyFetchData];
} else { } else {
_needsDataFetch = YES; _needsDataFetch = YES;
} }
@@ -1802,10 +1802,13 @@ static BOOL ShouldUseNewRenderingRange = YES;
BOOL nowFetchData = ASInterfaceStateIncludesFetchData(newState); BOOL nowFetchData = ASInterfaceStateIncludesFetchData(newState);
BOOL wasFetchData = ASInterfaceStateIncludesFetchData(oldState); BOOL wasFetchData = ASInterfaceStateIncludesFetchData(oldState);
if (nowFetchData != wasFetchData || _needsDataFetch) { // When a node has been queued up for a data fetch via setNeedsDataFetch, override the default behavior
if (nowFetchData || _needsDataFetch) { if (_needsDataFetch) {
[self fetchData]; [self recursivelyFetchData];
_needsDataFetch = NO; _needsDataFetch = NO;
} else if (nowFetchData != wasFetchData) {
if (nowFetchData) {
[self fetchData];
} else { } else {
if ([self supportsRangeManagedInterfaceState]) { if ([self supportsRangeManagedInterfaceState]) {
[self clearFetchedData]; [self clearFetchedData];