File tree Expand file tree Collapse file tree 1 file changed +0
-17
lines changed
source/views/streaming/webcams Expand file tree Collapse file tree 1 file changed +0
-17
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ type Props = {}
2020type State = {
2121 webcams : Array < Webcam > ,
2222 loading : boolean ,
23- refreshing : boolean ,
2423}
2524
2625export class WebcamsView extends React . PureComponent < Props , State > {
@@ -32,28 +31,12 @@ export class WebcamsView extends React.PureComponent<Props, State> {
3231 state = {
3332 webcams : defaultData . data ,
3433 loading : false ,
35- refreshing : false ,
3634 }
3735
3836 componentDidMount ( ) {
3937 this . fetchData ( )
4038 }
4139
42- refresh = async ( ) => {
43- const start = Date . now ( )
44- this . setState ( ( ) => ( { refreshing : true } ) )
45-
46- await this . fetchData ( )
47-
48- // wait 0.5 seconds – if we let it go at normal speed, it feels broken.
49- const elapsed = Date . now ( ) - start
50- if ( elapsed < 500 ) {
51- await delay ( 500 - elapsed )
52- }
53-
54- this . setState ( ( ) => ( { refreshing : false } ) )
55- }
56-
5740 fetchData = async ( ) => {
5841 this . setState ( ( ) => ( { loading : true } ) )
5942
You can’t perform that action at this time.
0 commit comments