Skip to content

Commit a855996

Browse files
committed
fix: null ref when fetch catch
1 parent 5538d9d commit a855996

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/generators/web/ui/hooks/useOrama.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ export default pathname => {
2727
if (!loaded.current) {
2828
loaded.current = fetch(relativeOrAbsolute('/orama-db.json', pathname))
2929
.then(response => response.ok && response.json())
30-
.then(data => load(db, data));
30+
.then(data => load(db, data))
31+
.catch(() => {
32+
loaded.current = null;
33+
});
3134
}
3235

3336
return loaded.current;

0 commit comments

Comments
 (0)