From fe1902cdcc96fd061ea4684c0dee25e35a7186f1 Mon Sep 17 00:00:00 2001 From: Precious Onyenaucheya Date: Tue, 29 Oct 2024 13:53:51 +0000 Subject: [PATCH] update from tenary to if else statement block --- src/components/autosuggest/autosuggest.ui.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/autosuggest/autosuggest.ui.js b/src/components/autosuggest/autosuggest.ui.js index 1ec3d796b9..8f793ff907 100644 --- a/src/components/autosuggest/autosuggest.ui.js +++ b/src/components/autosuggest/autosuggest.ui.js @@ -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);