1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-09-18 21:00:38 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

v10.0.0-beta.2

This commit is contained in:
sunnylqm
2024-01-25 22:07:01 +08:00
parent 296498e20a
commit 05e5c5a1a7
11 changed files with 67 additions and 72 deletions

View File

@@ -33,10 +33,7 @@ function App() {
const [showUpdateBanner, setShowUpdateBanner] = useState(false);
const [showUpdateSnackbar, setShowUpdateSnackbar] = useState(false);
const snackbarVisible =
showUpdateSnackbar &&
updateInfo &&
updateInfo.updateAvailable &&
!useDefaultAlert;
showUpdateSnackbar && updateInfo?.update && !useDefaultAlert;
return (
<View style={styles.container}>
<Text style={styles.welcome}>使Pushy热更新服务</Text>
@@ -48,8 +45,8 @@ function App() {
value={useDefaultAlert}
onValueChange={v => {
setUseDefaultAlert(v);
client.setOptions({
showAlert: v,
client?.setOptions({
useAlert: v,
});
}}
/>
@@ -80,7 +77,7 @@ function App() {
setShowTestConsole(true);
}}>
<Text style={styles.instructions}>
react-native-update版本{client.version}
react-native-update版本{client?.version}
</Text>
</TouchableOpacity>
<TestConsole visible={showTestConsole} />
@@ -98,7 +95,7 @@ function App() {
setShowUpdateBanner(true);
},
}}>
<Text>({updateInfo.version})</Text>
<Text>({updateInfo.name})</Text>
</Snackbar>
)}
<Banner
@@ -147,7 +144,6 @@ const styles = StyleSheet.create({
const pushyClient = new Pushy({
appKey,
showAlert: false,
});
export default function Root() {