This repository was archived by the owner on Feb 2, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1143,7 +1143,15 @@ - (void)_completePendingLayoutTransition
11431143 [self setCalculatedDisplayNodeLayout: _pendingLayoutTransition.pendingLayout];
11441144 [self _completeLayoutTransition: _pendingLayoutTransition];
11451145 }
1146- [self _pendingLayoutTransitionDidComplete ];
1146+
1147+ // Trampoline to the main thread if necessary
1148+ if (_pendingLayoutTransition && _pendingLayoutTransition.isSynchronous == NO ) {
1149+ [self _pendingLayoutTransitionDidComplete ];
1150+ } else {
1151+ ASPerformBlockOnMainThread (^{
1152+ [self _pendingLayoutTransitionDidComplete ];
1153+ });
1154+ }
11471155}
11481156
11491157/*
@@ -1158,7 +1166,7 @@ - (void)_completeLayoutTransition:(ASLayoutTransition *)layoutTransition
11581166 }
11591167
11601168 // Trampoline to the main thread if necessary
1161- if (ASDisplayNodeThreadIsMain () || layoutTransition.isSynchronous == NO ) {
1169+ if (layoutTransition.isSynchronous == NO ) {
11621170 [layoutTransition commitTransition ];
11631171 } else {
11641172 // Subnode insertions and removals need to happen always on the main thread if at least one subnode is already loaded
@@ -1186,7 +1194,7 @@ - (void)_pendingLayoutTransitionDidComplete
11861194 if (CGSizeEqualToSize (layoutSize, CGSizeZero)) {
11871195 return ;
11881196 }
1189-
1197+
11901198 if (!_placeholderImage) {
11911199 _placeholderImage = [self placeholderImage ];
11921200 }
You can’t perform that action at this time.
0 commit comments