Skip to content

Commit 68728d5

Browse files
committed
make OtherModes load by default (but not refresh)
1 parent 18afb2b commit 68728d5

File tree

1 file changed

+5
-3
lines changed
  • source/views/transportation/other-modes

1 file changed

+5
-3
lines changed

source/views/transportation/other-modes/list.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,14 @@ export class OtherModesView extends React.PureComponent<void, Props, State> {
4444

4545
state = {
4646
modes: defaultData.data,
47-
loading: false,
47+
loading: true,
4848
refreshing: false,
4949
}
5050

5151
componentWillMount() {
52-
this.fetchData()
52+
this.fetchData().then(() => {
53+
this.setState(() => ({loading: false}))
54+
})
5355
}
5456

5557
refresh = async () => {
@@ -77,7 +79,7 @@ export class OtherModesView extends React.PureComponent<void, Props, State> {
7779
modes = defaultData.data
7880
}
7981

80-
this.setState(() => ({modes, loading: false}))
82+
this.setState(() => ({modes}))
8183
}
8284

8385
onPress = (mode: OtherModeType) => {

0 commit comments

Comments
 (0)