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

fix: component would fail to load when using an instantsearch adapter #16

Merged
merged 2 commits into from
Sep 15, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/lib/InstantSearch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@

search.start();

searchClient.addAlgoliaAgent("svelte-algolia-instantsearch", "1.0.0");
// Try to add a custom user agent, but don't crash on fail since some instantsearch.js adapters don't have this.
try {
searchClient.addAlgoliaAgent("svelte-algolia-instantsearch", "1.0.0");
} catch (e) {
// ignore
}
djdembeck marked this conversation as resolved.
Show resolved Hide resolved

if (serverContext) {
tick().then(() => {
Expand Down