Skip to content

Commit

Permalink
Helper for shouldDisplay
Browse files Browse the repository at this point in the history
So it autotracks setting changes
  • Loading branch information
davidtaylorhq committed Apr 9, 2024
1 parent f7dd7fc commit 0f2d77b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ function initializeAutocomplete(options) {
export default apiInitializer("0.8", (api) => {
const siteSettings = api.container.lookup("service:site-settings");
const currentUser = api.getCurrentUser();
const shouldDisplay =
const shouldDisplay = () =>
siteSettings.algolia_enabled &&
siteSettings.algolia_autocomplete_enabled &&
(!siteSettings.login_required || currentUser);
Expand All @@ -309,7 +309,7 @@ export default apiInitializer("0.8", (api) => {
}

api.headerIcons.add("algolia", <template>
{{#if shouldDisplay}}
{{#if (shouldDisplay)}}
<li class="algolia-holder" {{didInsert renderAlgolia}}>
<div class="algolia-search"></div>
<div class="algolia-autocomplete"></div>
Expand Down

0 comments on commit 0f2d77b

Please sign in to comment.