summaryrefslogtreecommitdiffstats
path: root/browser/components/urlbar/private/YelpSuggestions.sys.mjs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-23 04:29:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-23 04:29:08 +0000
commit0ce6c14b1b17b78e45c0592bd3e404adbc26ed3e (patch)
treec8c48fae9c5a35b94ab93af4fc24cf1d2fb4bdf1 /browser/components/urlbar/private/YelpSuggestions.sys.mjs
parentAdding upstream version 125.0.1. (diff)
downloadfirefox-0ce6c14b1b17b78e45c0592bd3e404adbc26ed3e.tar.xz
firefox-0ce6c14b1b17b78e45c0592bd3e404adbc26ed3e.zip
Adding upstream version 125.0.2.upstream/125.0.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/urlbar/private/YelpSuggestions.sys.mjs')
-rw-r--r--browser/components/urlbar/private/YelpSuggestions.sys.mjs18
1 files changed, 5 insertions, 13 deletions
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() {