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

Rename hashname -> hash

This commit is contained in:
sunnylqm
2020-09-24 22:44:37 +08:00
parent bcd61315e9
commit 17dffa1eb5
5 changed files with 51 additions and 52 deletions

View File

@@ -9,7 +9,6 @@ const {
version: v,
} = require('react-native/Libraries/Core/ReactNativeVersion');
const RNVersion = `${v.major}.${v.minor}.${v.patch}`;
const uuidv4 = require('uuid/v4');
let Pushy = NativeModules.Pushy;
@@ -35,7 +34,7 @@ if (Platform.OS === 'android' && !Pushy.isUsingBundleUrl) {
const eventEmitter = new NativeEventEmitter(Pushy);
if (!uuid) {
uuid = uuidv4();
uuid = require('uuid/v4')();
Pushy.setUuid(uuid);
}
@@ -158,14 +157,14 @@ export async function downloadUpdate(options, eventListeners) {
logger('downloading diff');
await Pushy.downloadPatchFromPpk({
updateUrl: options.diffUrl,
hashName: options.hash,
originHashName: currentVersion,
hash: options.hash,
originHash: currentVersion,
});
} else if (options.pdiffUrl) {
logger('downloading pdiff');
await Pushy.downloadPatchFromPackage({
updateUrl: options.pdiffUrl,
hashName: options.hash,
hash: options.hash,
});
}
eventEmitter.removeAllListeners('RCTPushyDownloadProgress');
@@ -175,13 +174,13 @@ export async function downloadUpdate(options, eventListeners) {
export function switchVersion(hash) {
assertRelease();
logger('switchVersion');
Pushy.reloadUpdate({ hashName: hash });
Pushy.reloadUpdate({ hash });
}
export function switchVersionLater(hash) {
assertRelease();
logger('switchVersionLater');
Pushy.setNeedUpdate({ hashName: hash });
Pushy.setNeedUpdate({ hash });
}
export function markSuccess() {