From e3cb9707d5a825c871111670200af02af1718195 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 23 Apr 2024 06:29:10 +0200 Subject: Merging upstream version 125.0.2. Signed-off-by: Daniel Baumann --- .../components/urlbar/private/YelpSuggestions.sys.mjs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'browser/components/urlbar/private/YelpSuggestions.sys.mjs') diff --git a/browser/components/urlbar/private/YelpSuggestions.sys.mjs b/browser/components/urlbar/private/YelpSuggestions.sys.mjs index a1ac13177b..4cf454c71d 100644 --- a/browser/components/urlbar/private/YelpSuggestions.sys.mjs +++ b/browser/components/urlbar/private/YelpSuggestions.sys.mjs @@ -227,19 +227,11 @@ export class YelpSuggestions extends BaseFeature { } get #minKeywordLength() { - // It's unusual to get both a Nimbus variable and its fallback pref at the - // same time, but we have a good reason. To recap, if a variable doesn't - // have a value, then the value of its fallback will be returned; otherwise - // the variable value will be returned. That's usually what we want, but for - // Yelp, we set the pref each time the user clicks "show less frequently", - // and we want the variable to act only as an initial min length. In other - // words, if the pref has a user value (because we set it), use it; - // otherwise use the initial value defined by the variable. - return Math.max( - lazy.UrlbarPrefs.get("yelpMinKeywordLength") || 0, - lazy.UrlbarPrefs.get("yelp.minKeywordLength") || 0, - 0 - ); + let minLength = + lazy.UrlbarPrefs.get("yelp.minKeywordLength") || + lazy.UrlbarPrefs.get("yelpMinKeywordLength") || + 0; + return Math.max(minLength, 0); } async #fetchCity() { -- cgit v1.2.3