Skip to content

Commit bb693b1

Browse files
committed
fixup!
1 parent 6b0e248 commit bb693b1

2 files changed

Lines changed: 4 additions & 13 deletions

File tree

apps/site/scripts/orama/index.mjs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,11 @@ const prefixDocs = (db, prefix) => ({
1717
},
1818
});
1919

20-
// Load both URLs and sort by size, larger first
20+
// Load both URLs and prefix the hrefs with the appropriate path
2121
const loaded = await Promise.all([
22-
await fetch(LEARN_ORAMA_DB_URL).then(res => res.json()),
23-
await fetch(BETA_DOCS_ORAMA_DB_URL).then(res => res.json()),
24-
]).then(([a, b]) =>
25-
[prefixDocs(a, '/learn'), prefixDocs(b, '/api')].sort(
26-
(a, b) => b.docs.length - a.docs.length
27-
)
28-
);
22+
fetch(LEARN_ORAMA_DB_URL).then(res => res.json()),
23+
fetch(BETA_DOCS_ORAMA_DB_URL).then(res => res.json()),
24+
]).then(([a, b]) => [prefixDocs(a, '/learn'), prefixDocs(b, '/api')]);
2925

3026
const orama = create({ schema: {} });
3127
load(orama, loaded.shift());

packages/ui-components/src/hooks/useOrama.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ export default function useOrama(path: string): OramaCloud | null {
5151

5252
// TODO(@avivkeller): Orama might need to be replaced
5353
db.search = async (options: SearchOptions): Promise<unknown> => {
54-
try {
55-
search(db, options);
56-
} catch (e) {
57-
console.error(e);
58-
}
5954
await ensureLoaded();
6055
return search(db, options);
6156
};

0 commit comments

Comments
 (0)