quran / quran.com-frontend

quran.com frontend
https://quran.com
MIT License
994 stars 360 forks source link

Ensure suggestions is an array and close autocomplete on search #1040

Closed nabeel- closed 5 years ago

nabeel- commented 6 years ago

Ensure suggestions is an array and close autocomplete on search

When a search yields no suggestions the backend will produce a malformed response in the form {"": []} (given that the structure should be [{...result...}, ...]), which causes the front-end to choke. This cleans that up to ensure we always put an array into the redux store. Ideally this would be fixed on the back-end but ensuring an array on the front-end could also be a worth-while addition.

Also closes the autocomplete when a search is initiated as a small quality-of-life improvement to the search experience.

Checklist

mmahalwy commented 6 years ago

rebuild

mmahalwy commented 6 years ago

rebuild

ahmedre commented 6 years ago

Deployed to: http://staging.quran.com:32776

ahmedre commented 5 years ago

Deployed to: http://staging.quran.com:32819