Commit 46c7d121 authored by Florent Chehab's avatar Florent Chehab
Browse files

Bug corrected in MyComponent

parent 557fe751
...@@ -35,10 +35,10 @@ class MyComponent extends Component { ...@@ -35,10 +35,10 @@ class MyComponent extends Component {
const { props } = this; const { props } = this;
for (let prop_key in props) { for (let prop_key in props) {
let prop = props[prop_key]; let prop = props[prop_key];
if (typeof prop == 'boolean') { // if (typeof prop == 'boolean') {
continue; // continue;
} // }
if (prop && 'fetched' in prop) { if (prop === Object(prop) && 'fetched' in prop) {
out[prop_key] = prop.fetched.data; out[prop_key] = prop.fetched.data;
} }
} }
...@@ -58,10 +58,10 @@ class MyComponent extends Component { ...@@ -58,10 +58,10 @@ class MyComponent extends Component {
const { props } = this; const { props } = this;
for (let el in props) { for (let el in props) {
let prop = props[el]; let prop = props[el];
if (typeof prop == 'boolean') { // if (typeof prop == 'boolean') {
continue; // continue;
} // }
if (prop && val in prop && prop[val]) { if (prop === Object(prop) && val in prop && prop[val]) {
return true; return true;
} }
} }
...@@ -75,7 +75,7 @@ class MyComponent extends Component { ...@@ -75,7 +75,7 @@ class MyComponent extends Component {
if (typeof prop == 'boolean') { if (typeof prop == 'boolean') {
continue; continue;
} }
if (prop && 'fetchHasError' in prop) { if (prop === Object(prop) && 'fetchHasError' in prop) {
if (prop.fetchHasError.status) { if (prop.fetchHasError.status) {
if (prop_key in this.customErrorHandlers) { if (prop_key in this.customErrorHandlers) {
console.log("icicicicici"); console.log("icicicicici");
...@@ -110,7 +110,7 @@ class MyComponent extends Component { ...@@ -110,7 +110,7 @@ class MyComponent extends Component {
if (typeof prop == 'boolean') { if (typeof prop == 'boolean') {
continue; continue;
} }
if (prop && 'fetched' in prop) { if (prop === Object(prop) && 'fetched' in prop) {
if ((!prop.fetched.fetchedAt) || prop.invalidated) { if ((!prop.fetched.fetchedAt) || prop.invalidated) {
if (!prop.isLoading) { if (!prop.isLoading) {
props.fetchData[prop_key](); props.fetchData[prop_key]();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment