Skip to content

Commit 1dceec5

Browse files
authored
Merge pull request #1634 from StoDevX/balances-view
Check for loginState in the balancesview
2 parents 65d9c47 + bd91f85 commit 1dceec5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

source/views/sis/balances.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {StyleSheet, ScrollView, View, Text, RefreshControl} from 'react-native'
99
import {TabBarIcon} from '../components/tabbar-icon'
1010
import {connect} from 'react-redux'
1111
import {Cell, TableView, Section} from 'react-native-tableview-simple'
12+
import type {LoginStateType} from '../../flux/parts/settings'
1213

1314
import {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

Comments
 (0)