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

Bug corrected in MyComponent

parent 557fe751
......@@ -35,10 +35,10 @@ class MyComponent extends Component {
const { props } = this;
for (let prop_key in props) {
let prop = props[prop_key];
if (typeof prop == 'boolean') {
continue;
}
if (prop && 'fetched' in prop) {
// if (typeof prop == 'boolean') {
// continue;
// }
if (prop === Object(prop) && 'fetched' in prop) {
out[prop_key] = prop.fetched.data;
}
}
......@@ -58,10 +58,10 @@ class MyComponent extends Component {
const { props } = this;
for (let el in props) {
let prop = props[el];
if (typeof prop == 'boolean') {
continue;
}
if (prop && val in prop && prop[val]) {
// if (typeof prop == 'boolean') {
// continue;
// }
if (prop === Object(prop) && val in prop && prop[val]) {
return true;
}
}
......@@ -75,7 +75,7 @@ class MyComponent extends Component {
if (typeof prop == 'boolean') {
continue;
}
if (prop && 'fetchHasError' in prop) {
if (prop === Object(prop) && 'fetchHasError' in prop) {
if (prop.fetchHasError.status) {
if (prop_key in this.customErrorHandlers) {
console.log("icicicicici");
......@@ -110,7 +110,7 @@ class MyComponent extends Component {
if (typeof prop == 'boolean') {
continue;
}
if (prop && 'fetched' in prop) {
if (prop === Object(prop) && 'fetched' in prop) {
if ((!prop.fetched.fetchedAt) || prop.invalidated) {
if (!prop.isLoading) {
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