mirror of
				https://gitcode.com/gh_mirrors/re/react-native-pushy.git
				synced 2025-10-31 21:33:12 +08:00 
			
		
		
		
	bugfixes
This commit is contained in:
		| @@ -124,6 +124,14 @@ public class UpdateContext { | ||||
|         this.clearUp(); | ||||
|     } | ||||
|  | ||||
|     public void clearRollbackMark() { | ||||
|         SharedPreferences.Editor editor = sp.edit(); | ||||
|         editor.putBoolean("rolledBack", false); | ||||
|         editor.apply(); | ||||
|  | ||||
|         this.clearUp(); | ||||
|     } | ||||
|  | ||||
|     public static String getBundleUrl(Context context) { | ||||
|         return new UpdateContext(context.getApplicationContext()).getBundleUrl(); | ||||
|     } | ||||
| @@ -133,7 +141,7 @@ public class UpdateContext { | ||||
|     } | ||||
|  | ||||
|     public String getBundleUrl() { | ||||
|         return this.getBundleUrl((String)null); | ||||
|         return this.getBundleUrl((String) null); | ||||
|     } | ||||
|  | ||||
|     public String getBundleUrl(String defaultAssetsUrl) { | ||||
| @@ -150,7 +158,7 @@ public class UpdateContext { | ||||
|             editor.putBoolean("shouldRollback", true); | ||||
|             editor.apply(); | ||||
|         } | ||||
|         return new File(rootDir, currentVersion+"/index.bundlejs").toURI().toString(); | ||||
|         return (new File(rootDir, currentVersion+"/index.bundlejs").toString()); | ||||
|     } | ||||
|  | ||||
|     private void rollBack() { | ||||
|   | ||||
| @@ -34,8 +34,12 @@ public class UpdateModule extends ReactContextBaseJavaModule{ | ||||
|         constants.put("downloadRootDir", updateContext.getRootDir()); | ||||
|         constants.put("packageVersion", updateContext.getPackageVersion()); | ||||
|         constants.put("currentVersion", updateContext.getCurrentVersion()); | ||||
|         constants.put("firstTime", updateContext.isFirstTime()); | ||||
|         constants.put("rolledBack", updateContext.isRolledBack()); | ||||
|         constants.put("isFirstTime", updateContext.isFirstTime()); | ||||
|         boolean isRolledBack = updateContext.isRolledBack(); | ||||
|         constants.put("isRolledBack", isRolledBack); | ||||
|         if (isRolledBack) { | ||||
|             updateContext.clearRollbackMark(); | ||||
|         } | ||||
|         return constants; | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 tdzl2003
					tdzl2003