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

Fix download event and remove unzip event

This commit is contained in:
sunnylqm
2020-09-24 19:31:27 +08:00
parent 4ba3f25972
commit f626cc1933
4 changed files with 23 additions and 24 deletions

1
lib/index.d.ts vendored
View File

@@ -34,7 +34,6 @@ export function downloadUpdate(
info: UpdateAvailableResult,
eventListeners?: {
onDownloadProgress?: (data: ProgressData) => void;
onUnzipProgress?: (data: ProgressData) => void;
},
): Promise<undefined | string>;

View File

@@ -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;
}