1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-11-03 14:53:10 +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

@@ -73,18 +73,18 @@ export const PushyProvider = ({
);
const switchVersion = useCallback(
(info: CheckResult | undefined = updateInfoRef.current) => {
async (info: CheckResult | undefined = updateInfoRef.current) => {
if (info && info.hash) {
client.switchVersion(info.hash);
return client.switchVersion(info.hash);
}
},
[client],
);
const switchVersionLater = useCallback(
(info: CheckResult | undefined = updateInfoRef.current) => {
async (info: CheckResult | undefined = updateInfoRef.current) => {
if (info && info.hash) {
client.switchVersionLater(info.hash);
return client.switchVersionLater(info.hash);
}
},
[client],