File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
src/client/src/pages/DataView360/View Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -52,13 +52,12 @@ class View360 extends Component {
52
52
}
53
53
54
54
async componentDidMount ( ) {
55
- this . setState ( {
55
+ await this . setState ( {
56
56
isDataBusy : true ,
57
57
showSearchBar : false ,
58
58
matchId : _ . last ( this . props . location . pathname . split ( '/' ) )
59
59
} ) ;
60
60
61
- await new Promise ( resolve => setTimeout ( resolve , 1000 ) ) ;
62
61
let response = await fetch ( `/api/360/${ this . state . matchId } ` ,
63
62
{
64
63
method : 'GET' ,
@@ -77,14 +76,14 @@ class View360 extends Component {
77
76
let fosterEvents = { } ;
78
77
79
78
for ( let id of animalIds ) {
80
- this . getAnimalEvents ( id , this . state . matchId ) . then ( ( events ) => {
81
- adoptionEvents [ id ] = _ . filter ( events [ id ] , function ( e ) {
82
- return e [ "Type" ] && e [ "Type" ] . toLowerCase ( ) . includes ( "adopt" ) ;
83
- } ) ;
84
- fosterEvents [ id ] = _ . filter ( events [ id ] , function ( e ) {
85
- return e [ "Type" ] && e [ "Type" ] . toLowerCase ( ) . includes ( "foster" ) ;
86
- } ) ;
87
- } )
79
+ let events = await this . getAnimalEvents ( id , this . state . matchId ) ;
80
+
81
+ adoptionEvents [ id ] = _ . filter ( events [ id ] , function ( e ) {
82
+ return e [ "Type" ] && e [ "Type" ] . toLowerCase ( ) . includes ( "adopt" ) ;
83
+ } ) ;
84
+ fosterEvents [ id ] = _ . filter ( events [ id ] , function ( e ) {
85
+ return e [ "Type" ] && e [ "Type" ] . toLowerCase ( ) . includes ( "foster" ) ;
86
+ } ) ;
88
87
}
89
88
90
89
this . setState ( {
You can’t perform that action at this time.
0 commit comments