From 10ab9d2f41c7a1fc549535deb86736520b984d86 Mon Sep 17 00:00:00 2001 From: Gabriel Mechali Date: Thu, 31 Oct 2024 17:15:18 -0400 Subject: [PATCH 1/2] Autopush env bug fix. --- .../nl_search_bar/nl_search_bar_header_inline.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/static/js/components/nl_search_bar/nl_search_bar_header_inline.tsx b/static/js/components/nl_search_bar/nl_search_bar_header_inline.tsx index 6aed4822e3..3660fd84f9 100644 --- a/static/js/components/nl_search_bar/nl_search_bar_header_inline.tsx +++ b/static/js/components/nl_search_bar/nl_search_bar_header_inline.tsx @@ -34,10 +34,9 @@ const NlSearchBarHeaderInline = ({ }: NlSearchBarImplementationProps): ReactElement => { const urlParams = new URLSearchParams(window.location.search); const isAutopushEnv = window.location.hostname == "autopush.datacommons.org"; - const enableAutoComplete = - isAutopushEnv || urlParams.has("ac_on") - ? urlParams.get("ac_on") == "true" - : false; + const enableAutoComplete = isAutopushEnv + ? true + : urlParams.has("ac_on") && urlParams.get("ac_on") == "true"; return (
From b8111d1cf232110b7ceaca9042ece3eebb691c9e Mon Sep 17 00:00:00 2001 From: Gabriel Mechali Date: Thu, 31 Oct 2024 17:17:36 -0400 Subject: [PATCH 2/2] Cleaner formatting --- .../nl_search_bar/nl_search_bar_header_inline.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/js/components/nl_search_bar/nl_search_bar_header_inline.tsx b/static/js/components/nl_search_bar/nl_search_bar_header_inline.tsx index 3660fd84f9..7714cb4bf5 100644 --- a/static/js/components/nl_search_bar/nl_search_bar_header_inline.tsx +++ b/static/js/components/nl_search_bar/nl_search_bar_header_inline.tsx @@ -34,9 +34,9 @@ const NlSearchBarHeaderInline = ({ }: NlSearchBarImplementationProps): ReactElement => { const urlParams = new URLSearchParams(window.location.search); const isAutopushEnv = window.location.hostname == "autopush.datacommons.org"; - const enableAutoComplete = isAutopushEnv - ? true - : urlParams.has("ac_on") && urlParams.get("ac_on") == "true"; + const enableAutoComplete = + isAutopushEnv || + (urlParams.has("ac_on") && urlParams.get("ac_on") == "true"); return (