mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 14:45:21 +00:00
Recursively fetchData for requests
This commit is contained in:
@@ -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];
|
||||||
|
|||||||
Reference in New Issue
Block a user