mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-09-17 01:08:05 +00:00
[ASDataController] If app code issues edit commands before first reload, ignore them, as UIKit will call -reloadData.
This commit is contained in:
parent
cc7ca4a08f
commit
6a32e5ccc0
@ -328,6 +328,9 @@ static void *kASSizingQueueContext = &kASSizingQueueContext;
|
|||||||
*/
|
*/
|
||||||
- (void)_insertNodes:(NSArray *)nodes atIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions
|
- (void)_insertNodes:(NSArray *)nodes atIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions
|
||||||
{
|
{
|
||||||
|
if (indexPaths.count == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
[self insertNodes:nodes ofKind:ASDataControllerRowNodeKind atIndexPaths:indexPaths completion:^(NSArray *nodes, NSArray *indexPaths) {
|
[self insertNodes:nodes ofKind:ASDataControllerRowNodeKind atIndexPaths:indexPaths completion:^(NSArray *nodes, NSArray *indexPaths) {
|
||||||
if (_delegateDidInsertNodes)
|
if (_delegateDidInsertNodes)
|
||||||
[_delegate dataController:self didInsertNodes:nodes atIndexPaths:indexPaths withAnimationOptions:animationOptions];
|
[_delegate dataController:self didInsertNodes:nodes atIndexPaths:indexPaths withAnimationOptions:animationOptions];
|
||||||
@ -342,6 +345,9 @@ static void *kASSizingQueueContext = &kASSizingQueueContext;
|
|||||||
*/
|
*/
|
||||||
- (void)_deleteNodesAtIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions
|
- (void)_deleteNodesAtIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions
|
||||||
{
|
{
|
||||||
|
if (indexPaths.count == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
[self deleteNodesOfKind:ASDataControllerRowNodeKind atIndexPaths:indexPaths completion:^(NSArray *nodes, NSArray *indexPaths) {
|
[self deleteNodesOfKind:ASDataControllerRowNodeKind atIndexPaths:indexPaths completion:^(NSArray *nodes, NSArray *indexPaths) {
|
||||||
if (_delegateDidDeleteNodes)
|
if (_delegateDidDeleteNodes)
|
||||||
[_delegate dataController:self didDeleteNodes:nodes atIndexPaths:indexPaths withAnimationOptions:animationOptions];
|
[_delegate dataController:self didDeleteNodes:nodes atIndexPaths:indexPaths withAnimationOptions:animationOptions];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user