File tree Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -52,14 +52,13 @@ var fetchData = function fetchData() {
52
52
( 0 , _createClass3 . default ) ( Enhance , [ {
53
53
key : 'componentDidMount' ,
54
54
value : function componentDidMount ( ) {
55
- if ( isFirstLoadOnServer || notPreventFirstFetchOnBroswer ) {
55
+ if ( isFirstLoadOnServer && ! notPreventFirstFetchOnBroswer ) {
56
56
isFirstLoadOnServer = false ;
57
- if ( WrappedComponent . fetchData instanceof Function ) {
58
- WrappedComponent . fetchData ( {
59
- dispatch : this . props . dispatch ,
60
- match : this . props . match
61
- } ) ;
62
- }
57
+ } else if ( WrappedComponent . fetchData instanceof Function ) {
58
+ WrappedComponent . fetchData ( {
59
+ dispatch : this . props . dispatch ,
60
+ match : this . props . match
61
+ } ) ;
63
62
}
64
63
}
65
64
} , {
Original file line number Diff line number Diff line change @@ -7,14 +7,13 @@ const fetchData = (notPreventFirstFetchOnBroswer = false) => {
7
7
return ( WrappedComponent ) => {
8
8
class Enhance extends React . Component {
9
9
componentDidMount ( ) {
10
- if ( isFirstLoadOnServer || notPreventFirstFetchOnBroswer ) {
10
+ if ( isFirstLoadOnServer && ! notPreventFirstFetchOnBroswer ) {
11
11
isFirstLoadOnServer = false ;
12
- if ( WrappedComponent . fetchData instanceof Function ) {
13
- WrappedComponent . fetchData ( {
14
- dispatch : this . props . dispatch ,
15
- match : this . props . match
16
- } ) ;
17
- }
12
+ } else if ( WrappedComponent . fetchData instanceof Function ) {
13
+ WrappedComponent . fetchData ( {
14
+ dispatch : this . props . dispatch ,
15
+ match : this . props . match
16
+ } ) ;
18
17
}
19
18
}
20
19
render ( ) {
You can’t perform that action at this time.
0 commit comments