Surface: fixed up surface stage value check

Summary: Some logic to check for surface stage should've done bitwise `&` operation instead of equality check, because we do bitwise `|` whenever we "set stage".

Reviewed By: shergin

Differential Revision: D13459156

fbshipit-source-id: 94e2f5279fb1a31060beb7d6195953b25ce603c9
This commit is contained in:
Kevin Gozali 2018-12-13 16:49:31 -08:00 committed by Facebook Github Bot
parent e7cf870e31
commit 54a6e1ad38
1 changed files with 2 additions and 2 deletions

View File

@ -450,7 +450,7 @@
return NO; return NO;
} }
if (RCTIsMainQueue() && (stage == RCTSurfaceStageSurfaceDidInitialMounting)) { if (RCTIsMainQueue() && (stage & RCTSurfaceStageSurfaceDidInitialMounting)) {
// All main-threaded execution (especially mounting process) has to be // All main-threaded execution (especially mounting process) has to be
// intercepted, captured and performed synchnously at the end of this method // intercepted, captured and performed synchnously at the end of this method
// right after the semaphore signals. // right after the semaphore signals.
@ -485,7 +485,7 @@
dispatch_semaphore_signal(semaphore); dispatch_semaphore_signal(semaphore);
} }
if (RCTIsMainQueue() && (stage == RCTSurfaceStageSurfaceDidInitialMounting)) { if (RCTIsMainQueue() && (stage & RCTSurfaceStageSurfaceDidInitialMounting)) {
// Time to apply captured mounting block. // Time to apply captured mounting block.
RCTUIManagerMountingBlock mountingBlock; RCTUIManagerMountingBlock mountingBlock;
{ {