Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds option to disable search #128

Merged
merged 3 commits into from
Jan 16, 2024
Merged

Adds option to disable search #128

merged 3 commits into from
Jan 16, 2024

Conversation

alasdairwilson
Copy link
Collaborator

@alasdairwilson alasdairwilson commented Jan 12, 2024

closes #113 Adds a new env var:

"NEXT_PUBLIC_ENABLE_SEARCH" which, if "true" enables the frontend search dialogue and navbar component.

SET THE FLY SECRETS TO TRUE ON STAGING + PROD BEFORE DEPLOYING

@@ -0,0 +1 @@
export const enableSearch = process.env.NEXT_PUBLIC_ENABLE_SEARCH === "true" ? true : false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my own peace of mind, can we do an explicit check for if NEXT_PUBLIC_ENABLE_SEARCH is defined or not. I'm unsure if undefined === "true" will be true or false!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked and thankfully js isnt insane enough for that to be true, undefined with triple equals is only equal to undefined.

I added the check anyway though.

@alasdairwilson alasdairwilson merged commit b6bdba7 into main Jan 16, 2024
3 checks passed
@alasdairwilson alasdairwilson deleted the disabe-search branch January 16, 2024 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable search with an env var
2 participants