Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
doUpdate = async info => {
const hash = await downloadUpdate(info);
Alert.alert('提示', '下载完毕,是否重启应用?', [
{
text: '是',
onPress: () => {
switchVersion(hash);
},
},
{text: '否'},
{
text: '下次启动时',
onPress: () => {
switchVersionLater(hash);
},
},
]);
};
doUpdate = info => {
downloadUpdate(info).then(hash => {
Alert.alert('提示', '下载完毕,是否重启应用?', [
{text: '是', onPress: ()=>{switchVersion(hash)}},
{text: '否',},
{text: '下次启动时', onPress: ()=>{switchVersionLater(hash)}},
])
}).catch(err => {
Alert.alert('提示', '更新失败.')
})
}
check = () => {
doUpdate = info => {
downloadUpdate(info).then(hash => {
Alert.alert('提示', '下载完毕,是否重启应用?', [
{ text: '是', onPress: () => { switchVersion(hash); } },
{ text: '否', },
{ text: '下次启动时', onPress: () => { switchVersionLater(hash); } },
]);
}).catch(err => {
Alert.alert('提示', '更新失败.');
});
};
checkUpdate = () => {