mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-09-18 01:56:11 +08:00
Rename hashname -> hash
This commit is contained in:
13
lib/index.js
13
lib/index.js
@@ -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() {
|
||||
|
Reference in New Issue
Block a user