Skip to content

Commit

Permalink
update from tenary to if else statement block
Browse files Browse the repository at this point in the history
  • Loading branch information
precious-onyenaucheya-ons committed Oct 29, 2024
1 parent 38bff69 commit fe1902c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/autosuggest/autosuggest.ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,14 @@ export default class AutosuggestUI {
? this.customResultsThreshold
: 0.2;

const distance = threshold >= 0.6 ? 500 : threshold >= 0.4 ? 300 : 100;
let distance;
if (threshold >= 0.6) {
distance = 500;
} else if (threshold >= 0.4) {
distance = 300;
} else {
distance = 100;
}

const results = await runFuse(sanitisedQuery, data, this.lang, threshold, distance);

Expand Down

0 comments on commit fe1902c

Please sign in to comment.