dimaportenko / magento-react-native

React Native mobile app for Magento 2.x
MIT License
297 stars 158 forks source link

Hide slider if slider.length < 1 #118

Closed tylers-username closed 4 years ago

tylers-username commented 4 years ago

Describe the bug An error is thrown when an empty array is provided to the slider object.

Expected behavior Slider should be hidden

Current Behavior Error is thrown

Steps to Reproduce Create the homepage block of:

{
  "slider": [
  ],
  "featuredCategories": {
    "15": { "title": "Products"},
    "12": { "title": "Recipes"}
  }
}

OR

{
  "featuredCategories": {
    "15": { "title": "Products"},
    "12": { "title": "Recipes"}
  }
}
dimaportenko commented 4 years ago

Can you share the error?

dimaportenko commented 4 years ago

I don't see any issues related to the config you provided.

I recommend you to purge store data in case you had the wrong config and it was saved on the device. To do it go to the src/store/index.js and uncomment persistor.purge(); line.

tylers-username commented 4 years ago

I apologise for the lack of detail. I'm going to close this out since I can't provide further information at this time.

dimaportenko commented 4 years ago

no problem, feel free to reopen it if you have more details.