1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-09-18 18:00:40 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

Compare commits

..

4 Commits
5.2.1 ... 5.2.3

Author SHA1 Message Date
DengYun
b6a08a19c8 fix merge conflict 2019-08-16 17:01:01 +08:00
DengYun
ef53716df3 发布5.2.2 2019-08-16 15:13:55 +08:00
DengYun
551cbc33cc [Fix] 更妥当的方式处理iOS更新后立即回滚的问题 2019-08-16 13:21:47 +08:00
DengYun
56e6d790c1 Fix: 解决RN 0.59+ iOS更新后依然提示更新(一直回滚)的问题 2019-08-16 13:06:16 +08:00
2 changed files with 8 additions and 3 deletions

View File

@@ -59,6 +59,8 @@ typedef NS_ENUM(NSInteger, HotUpdateType) {
HotUpdateTypePatchFromPpk = 3, HotUpdateTypePatchFromPpk = 3,
}; };
static BOOL ignoreRollback = false;
@implementation RCTHotUpdate { @implementation RCTHotUpdate {
RCTHotUpdateManager *_fileManager; RCTHotUpdateManager *_fileManager;
} }
@@ -92,7 +94,7 @@ RCT_EXPORT_MODULE(RCTHotUpdate);
BOOL isFirstLoadOK = [updateInfo[paramIsFirstLoadOk] boolValue]; BOOL isFirstLoadOK = [updateInfo[paramIsFirstLoadOk] boolValue];
NSString *loadVersioin = curVersion; NSString *loadVersioin = curVersion;
BOOL needRollback = (isFirstTime == NO && isFirstLoadOK == NO) || loadVersioin.length<=0; BOOL needRollback = (!ignoreRollback && isFirstTime == NO && isFirstLoadOK == NO) || loadVersioin.length<=0;
if (needRollback) { if (needRollback) {
loadVersioin = lastVersion; loadVersioin = lastVersion;
@@ -112,7 +114,10 @@ RCT_EXPORT_MODULE(RCTHotUpdate);
[defaults synchronize]; [defaults synchronize];
// ...need clear files later // ...need clear files later
} }
else if (isFirstTime){ else if (isFirstTime && !ignoreRollback){
// bundleURL may be called many times, ignore rollbacks before process restarted again.
ignoreRollback = true;
NSMutableDictionary *newInfo = [[NSMutableDictionary alloc] initWithDictionary:updateInfo]; NSMutableDictionary *newInfo = [[NSMutableDictionary alloc] initWithDictionary:updateInfo];
newInfo[paramIsFirstTime] = @(NO); newInfo[paramIsFirstTime] = @(NO);
[defaults setObject:newInfo forKey:keyUpdateInfo]; [defaults setObject:newInfo forKey:keyUpdateInfo];

View File

@@ -1,6 +1,6 @@
{ {
"name": "react-native-update", "name": "react-native-update",
"version": "5.2.1", "version": "5.2.3",
"description": "react-native hot update", "description": "react-native hot update",
"main": "lib/index.js", "main": "lib/index.js",
"scripts": { "scripts": {