@@ -9,6 +9,7 @@ import {StyleSheet, ScrollView, View, Text, RefreshControl} from 'react-native'
99import { TabBarIcon } from '../components/tabbar-icon'
1010import { connect } from 'react-redux'
1111import { Cell , TableView , Section } from 'react-native-tableview-simple'
12+ import type { LoginStateType } from '../../flux/parts/settings'
1213
1314import { updateBalances } from '../../flux/parts/sis'
1415
@@ -30,7 +31,7 @@ class BalancesView extends React.Component {
3031 print : ?number ,
3132 weeklyMeals : ?number ,
3233 dailyMeals : ?number ,
33- credentialsValid : boolean ,
34+ loginState : LoginStateType ,
3435 message : ?string ,
3536
3637 updateBalances : boolean => any ,
@@ -121,9 +122,9 @@ class BalancesView extends React.Component {
121122 </ View >
122123 </ Section >
123124
124- { ! this . props . credentialsValid || this . props . message
125+ { this . props . loginState !== 'logged-in' || this . props . message
125126 ? < Section footer = "You'll need to log in again so we can update these numbers." >
126- { ! this . props . credentialsValid
127+ { this . props . loginState !== 'logged-in'
127128 ? < Cell
128129 cellStyle = "Basic"
129130 title = "Log in with St. Olaf"
@@ -152,7 +153,7 @@ function mapStateToProps(state) {
152153 dailyMeals : state . sis . balances . daily ,
153154 message : state . sis . balances . message ,
154155
155- credentialsValid : state . settings . credentials . valid ,
156+ loginState : state . settings . credentials . state ,
156157 }
157158}
158159
0 commit comments