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

Check stateListener

This commit is contained in:
sunnylqm
2021-11-10 22:31:23 +08:00
parent 80b0401b02
commit 686209d50e

View File

@@ -36,7 +36,7 @@ export function simpleUpdate(WrappedComponent) {
this.checkUpdate(); this.checkUpdate();
} }
componentWillUnmount() { componentWillUnmount() {
this.stateListener.remove(); this.stateListener && this.stateListener.remove();
} }
doUpdate = async (info) => { doUpdate = async (info) => {
try { try {
@@ -44,7 +44,7 @@ export function simpleUpdate(WrappedComponent) {
if (!hash) { if (!hash) {
return; return;
} }
this.stateListener.remove(); this.stateListener && this.stateListener.remove();
Alert.alert('提示', '下载完毕,是否立即更新?', [ Alert.alert('提示', '下载完毕,是否立即更新?', [
{ {
text: '以后再说', text: '以后再说',