Add support to store history and favourite words. #63
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a commonly requested feature to add support to have a list of words searched along with favourite words. The implementation involves a separate table to track the word, is_favourite and last_accessed_at time for sorting the list with recent entries. Whenever there is a word search or a notification lookup the word is recorded. If the same word is seen again then last_accessed_at time is updated. During notification lookup star action currently instead of read for testing toggles is_favourite to be 1 so that favourites page can list them. All favourites are a subset of historical entries. Since the table is stored in respective db the entries are per db and hence when user changes from English to French then the list will be empty. This is due to clicking on the entry from list so that the relevant language is used for lookup. E.g. Having test as a favourite under English and opting to French dictionary to lookup favourite English word doesn't make sense in French since there is no translation feature.
TODO :