Skip to content

Commit f2d68fe

Browse files
committed
enable sync
1 parent fc00184 commit f2d68fe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/hooks/useCatalog.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
import { useFireproof } from 'use-fireproof';
1+
import { useFireproof, toCloud } from 'use-fireproof';
22
import { useEffect, useMemo } from 'react';
33
import type { LocalVibe } from '../utils/vibeUtils';
44

55
export function useCatalog(userId: string, vibes: Array<LocalVibe>) {
66
if (!userId) throw new Error('No user ID provided');
77

88
const dbName = `vibe-catalog-${userId}`;
9-
const { database, useAllDocs } = useFireproof(dbName);
9+
const { database, useAllDocs } = useFireproof(dbName, {
10+
attach: toCloud()
11+
});
1012

1113
// Get real-time count of cataloged vibes
1214
const allDocsResult = useAllDocs() as {

0 commit comments

Comments
 (0)