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

Find a way to pass the names of indexes that exist from the server to the client #98

Open
cmfcmf opened this issue Jan 28, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@cmfcmf
Copy link
Owner

cmfcmf commented Jan 28, 2022

Follow-up of #85.

try {
const response = await fetch(`${baseUrl}search-index-${tag}.json`);
if (!response.ok) return EMPTY_INDEX;
json = await response.json();
} catch (err) {
// An index might not actually exist if no pages for it have been indexed.
// https://github.com/cmfcmf/docusaurus-search-local/issues/85
// TODO: we should somehow pass the names of indexes that exist to the
// client at build time instead of catching the error here.
return EMPTY_INDEX;
}

@cmfcmf cmfcmf added the enhancement New feature or request label Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant