Skip to content

Commit 569b8c1

Browse files
committed
provide default storage
1 parent a140c95 commit 569b8c1

3 files changed

Lines changed: 4 additions & 9 deletions

File tree

apps/events/src/Boot.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,7 @@ declare module '@tanstack/react-router' {
1515

1616
export function Boot() {
1717
return (
18-
<HypergraphAppProvider
19-
storage={localStorage}
20-
syncServerUri="http://localhost:3030"
21-
mapping={mapping}
22-
chainId={19411}
23-
>
18+
<HypergraphAppProvider syncServerUri="http://localhost:3030" mapping={mapping}>
2419
<RouterProvider router={router} />
2520
</HypergraphAppProvider>
2621
);

apps/next-example/src/components/providers.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function Providers({ children }: { children: React.ReactNode }) {
77
const storage = typeof window !== 'undefined' ? window.localStorage : (undefined as unknown as Storage);
88

99
return (
10-
<HypergraphAppProvider storage={storage} syncServerUri="http://localhost:3030" mapping={{}}>
10+
<HypergraphAppProvider syncServerUri="http://localhost:3030" mapping={{}}>
1111
{children}
1212
</HypergraphAppProvider>
1313
);

packages/hypergraph-react/src/HypergraphAppContext.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ export function useHypergraphAuth() {
215215
}
216216

217217
export type HypergraphAppProviderProps = Readonly<{
218-
storage: Identity.Storage;
218+
storage?: Identity.Storage;
219219
syncServerUri?: string;
220220
chainId?: number;
221221
children: ReactNode;
@@ -227,7 +227,7 @@ export type HypergraphAppProviderProps = Readonly<{
227227
// b) If identity is not found, create a new identity
228228
// (and store it in the sync server)
229229
export function HypergraphAppProvider({
230-
storage,
230+
storage = localStorage,
231231
syncServerUri = 'https://syncserver.hypergraph.thegraph.com',
232232
chainId = Connect.GEO_TESTNET.id,
233233
children,

0 commit comments

Comments
 (0)