ndimatteo / HULL

💀 Headless Shopify Starter – powered by Next.js + Sanity.io
https://hull.dev
MIT License
1.36k stars 167 forks source link

Empty filter and sorting array causes issues #105

Closed isaacmattern closed 1 year ago

isaacmattern commented 1 year ago

When filters and sorts are disabled, the collection-grid module still looks for items in each of these arrays and raises an issue which prevents rendering. This took awhile for me to figure out, and in order to resolve this issue, you have to add an item to the sort or filter array in shop settings.

Screen Shot 2022-08-24 at 5 48 26 PM

Above is an example of an error shown when trying to render a collection before you've added a sort to the sort array in shop settings.

ndimatteo commented 1 year ago

Hey there @isaacmattern sorry about that!

This is a good catch, glad you were able to resolve it. I just added a few more checks so that it doesn't fail if that data's not set in the Shop Settings.

isaacmattern commented 1 year ago

awesome! thank you so much for the quick fix

isaacmattern commented 1 year ago

actually, just wanted to make sure - does your fix account for the scenario when there are no added sort items? it looks like you just added a check for the filterGroups.