Skip to content
This repository has been archived by the owner on Jun 28, 2021. It is now read-only.

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

Merged
merged 2 commits into from
Jan 31, 2019

Conversation

nabeel-
Copy link
Contributor

@nabeel- nabeel- commented Oct 11, 2018

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

  • Unit tests written
  • Manually tested
  • Prettier & ESLint were run
  • New dependencies are included in package-lock.json

Copy link
Contributor

@mmahalwy mmahalwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome stuff! Thanks so much for doing this!

@mmahalwy
Copy link
Contributor

rebuild

Copy link
Contributor

@mmahalwy mmahalwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@mmahalwy
Copy link
Contributor

rebuild

@ahmedre
Copy link
Contributor

ahmedre commented Oct 26, 2018

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

@ahmedre
Copy link
Contributor

ahmedre commented Jan 31, 2019

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

@naveed-ahmad naveed-ahmad merged commit 0ce2931 into quran:master Jan 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants