mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-11-01 13:53:11 +08:00
Fix download event and remove unzip event
This commit is contained in:
1
lib/index.d.ts
vendored
1
lib/index.d.ts
vendored
@@ -34,7 +34,6 @@ export function downloadUpdate(
|
||||
info: UpdateAvailableResult,
|
||||
eventListeners?: {
|
||||
onDownloadProgress?: (data: ProgressData) => void;
|
||||
onUnzipProgress?: (data: ProgressData) => void;
|
||||
},
|
||||
): Promise<undefined | string>;
|
||||
|
||||
|
||||
@@ -153,14 +153,6 @@ export async function downloadUpdate(options, eventListeners) {
|
||||
}
|
||||
});
|
||||
}
|
||||
if (eventListeners.onUnzipProgress) {
|
||||
const unzipCallback = eventListeners.onUnzipProgress;
|
||||
eventEmitter.addListener('RCTPushyUnzipProgress', (progressData) => {
|
||||
if (progressData.hash === options.hash) {
|
||||
unzipCallback(progressData);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
if (options.diffUrl) {
|
||||
logger('downloading diff');
|
||||
@@ -177,7 +169,6 @@ export async function downloadUpdate(options, eventListeners) {
|
||||
});
|
||||
}
|
||||
eventEmitter.removeAllListeners('RCTPushyDownloadProgress');
|
||||
eventEmitter.removeAllListeners('RCTPushyUnzipProgress');
|
||||
return options.hash;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user