File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
source/views/streaming/streams Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -38,18 +38,20 @@ export class StreamListView extends React.PureComponent {
3838
3939 state : {
4040 error : ?Error ,
41- loaded : boolean ,
41+ loading : boolean ,
4242 refreshing : boolean ,
4343 streams : Array < { title : string , data : Array < StreamType > } > ,
4444 } = {
4545 error : null ,
46- loaded : false ,
46+ loading : true ,
4747 refreshing : false ,
4848 streams : [ ] ,
4949 }
5050
5151 componentWillMount ( ) {
52- this . getStreams ( )
52+ this . getStreams ( ) . then ( ( ) => {
53+ this . setState ( ( ) => ( { loading : false } ) )
54+ } )
5355 }
5456
5557 refresh = async ( ) => {
@@ -101,11 +103,7 @@ export class StreamListView extends React.PureComponent {
101103 const grouped = groupBy ( processed , j => j . $groupBy )
102104 const mapped = toPairs ( grouped ) . map ( ( [ title , data ] ) => ( { title, data} ) )
103105
104- this . setState ( ( ) => ( {
105- error : null ,
106- loaded : true ,
107- streams : mapped ,
108- } ) )
106+ this . setState ( ( ) => ( { error : null , streams : mapped } ) )
109107 } catch ( error ) {
110108 this . setState ( ( ) => ( { error : error . message } ) )
111109 console . warn ( error )
@@ -121,7 +119,7 @@ export class StreamListView extends React.PureComponent {
121119 renderItem = ( { item} : { item : StreamType } ) => < StreamRow stream = { item } />
122120
123121 render ( ) {
124- if ( ! this . state . loaded ) {
122+ if ( this . state . loading ) {
125123 return < LoadingView />
126124 }
127125
You can’t perform that action at this time.
0 commit comments