forked from vergnet/application-amicale
Improved vote eror handling
This commit is contained in:
parent
71f39a64cc
commit
299a940ba4
2 changed files with 9 additions and 5 deletions
|
@ -32,7 +32,6 @@ class AuthenticatedScreen extends React.Component<Props, State> {
|
|||
this.props.navigation.addListener('focus', this.onScreenFocus);
|
||||
this.fetchedData = new Array(this.props.links.length);
|
||||
this.errors = new Array(this.props.links.length);
|
||||
this.fetchData(); // TODO remove in prod (only use for fast refresh)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -53,7 +53,9 @@ const FAKE_TEAMS2 = {
|
|||
],
|
||||
};
|
||||
|
||||
type Props = {}
|
||||
type Props = {
|
||||
navigation: Object
|
||||
}
|
||||
|
||||
type State = {
|
||||
hasVoted: boolean,
|
||||
|
@ -135,9 +137,12 @@ export default class VoteScreen extends React.Component<Props, State> {
|
|||
return null;
|
||||
};
|
||||
|
||||
getScreen = (data: Array<Object>) => {
|
||||
data[0] = FAKE_TEAMS2;
|
||||
data[1] = FAKE_DATE;
|
||||
getScreen = (data: Array<Object | null>) => {
|
||||
// data[0] = FAKE_TEAMS2;
|
||||
// data[1] = FAKE_DATE;
|
||||
|
||||
if (data[1] === null)
|
||||
data[1] = {date_begin: null};
|
||||
|
||||
if (data[0] !== null) {
|
||||
this.teams = data[0].teams;
|
||||
|
|
Loading…
Reference in a new issue