mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-09-16 10:41:38 +08:00
chore: throttle switchversion
This commit is contained in:
@@ -322,10 +322,12 @@ function assertHash(hash: string) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let applyingUpdate = false;
|
||||||
export function switchVersion(hash: string) {
|
export function switchVersion(hash: string) {
|
||||||
assertRelease();
|
assertRelease();
|
||||||
if (assertHash(hash)) {
|
if (assertHash(hash) && !applyingUpdate) {
|
||||||
logger('switchVersion: ' + hash);
|
logger('switchVersion: ' + hash);
|
||||||
|
applyingUpdate = true;
|
||||||
PushyModule.reloadUpdate({ hash });
|
PushyModule.reloadUpdate({ hash });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user