【发布时间】:2018-03-29 07:27:04
【问题描述】:
我正在为 IOS 构建一个 React-native / Redux-thunk / Firebase 应用程序。这是我的 app.js 的一部分。
{
this.props.data.userConnected==false?
<View style={styles.container1}>
<Login/>
</View>
:null
}
{
this.props.data.userConnected==true?
<View style={styles.container1}>
<Connected/>
</View>
:null
}
当用户点击登录时,我正在使用 firebase.auth 函数,如果连接成功,我在 redux 存储中将变量 userConnected 设置为 true。我的问题是,大约 3 小时后,我的用户被断开连接,并且变量 userConnected 被设置为 false,因为它是初始值。
我真的不知道该怎么做,因为我在想除非应用程序被关闭并重新打开,否则无法再次初始化 redux 商店。
提前感谢您的建议。
【问题讨论】:
标签: firebase react-native redux firebase-authentication redux-thunk