Skip to content

Commit

Permalink
add suggestions to cache only if api returns non empty array
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikvirendrar committed Jul 24, 2024
1 parent c25b797 commit c4c85d3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ai4bharat/indic-transliterate",
"version": "1.3.5",
"version": "1.3.6",
"description": "Transliterate component for React",
"author": "AI4Bharat",
"license": "MIT",
Expand Down
4 changes: 0 additions & 4 deletions src/util/suggestions-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@ export const getTransliterateSuggestions = async (
} else {
if (showCurrentWordAsLastSuggestion) {
const fallback = [word];
cache[lang][word.toLowerCase()] = {
suggestions: fallback,
frequency: 1,
};
return fallback;
}
return [];
Expand Down

0 comments on commit c4c85d3

Please sign in to comment.