44import android .content .Intent ;
55import android .net .Uri ;
66import android .os .Build ;
7+ import android .os .Handler ;
8+ import android .os .Looper ;
79import com .facebook .react .bridge .Promise ;
810import com .facebook .react .bridge .ReactApplicationContext ;
911import com .facebook .react .bridge .ReactContext ;
1719public class UpdateModule extends NativePushySpec {
1820 UpdateContext updateContext ;
1921 public static ReactApplicationContext mContext ;
22+ private final Handler handler = new Handler (Looper .getMainLooper ());
2023 public UpdateModule (ReactApplicationContext reactContext , UpdateContext updateContext ) {
2124 super (reactContext );
2225 this .updateContext = updateContext ;
@@ -38,12 +41,22 @@ protected Map<String, Object> getTypedExportedConstants() {
3841 boolean isFirstTime = updateContext .isFirstTime ();
3942 constants .put ("isFirstTime" , isFirstTime );
4043 if (isFirstTime ) {
41- updateContext .clearFirstTime ();
44+ handler .postDelayed (new Runnable () {
45+ @ Override
46+ public void run () {
47+ updateContext .clearFirstTime ();
48+ }
49+ }, 2000 );
4250 }
4351 String rolledBackVersion = updateContext .rolledBackVersion ();
4452 constants .put ("rolledBackVersion" , rolledBackVersion );
4553 if (rolledBackVersion != null ) {
46- updateContext .clearRollbackMark ();
54+ handler .postDelayed (new Runnable () {
55+ @ Override
56+ public void run () {
57+ updateContext .clearRollbackMark ();
58+ }
59+ }, 2000 );
4760 }
4861 constants .put ("uuid" , updateContext .getKv ("uuid" ));
4962 return constants ;
0 commit comments