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

chore: Update switchVersion and switchVersionLater to be async functions

This commit is contained in:
sunnylqm
2024-08-16 10:48:39 +08:00
parent 6d980a4c04
commit 10178e1e64
3 changed files with 12 additions and 12 deletions

View File

@@ -126,7 +126,7 @@ export class Pushy {
PushyModule.markSuccess();
this.report({ type: 'markSuccess' });
};
switchVersion = (hash: string) => {
switchVersion = async (hash: string) => {
if (__DEV__) {
console.warn(
'您调用了switchVersion方法但是当前是开发环境不会进行任何操作。',
@@ -136,11 +136,11 @@ export class Pushy {
if (this.assertHash(hash) && !this.applyingUpdate) {
log('switchVersion: ' + hash);
this.applyingUpdate = true;
PushyModule.reloadUpdate({ hash });
return PushyModule.reloadUpdate({ hash });
}
};
switchVersionLater = (hash: string) => {
switchVersionLater = async (hash: string) => {
if (__DEV__) {
console.warn(
'您调用了switchVersionLater方法但是当前是开发环境不会进行任何操作。',
@@ -149,7 +149,7 @@ export class Pushy {
}
if (this.assertHash(hash)) {
log('switchVersionLater: ' + hash);
PushyModule.setNeedUpdate({ hash });
return PushyModule.setNeedUpdate({ hash });
}
};
checkUpdate = async (extra?: Record<string, any>) => {