feat: integrate Stripe for page purchases and reconciliation tasks

This commit is contained in:
DESKTOP-RTLN3BA\$punk 2026-03-31 18:39:45 -07:00
parent 17642493eb
commit a9fd45844d
31 changed files with 1948 additions and 166 deletions

View file

@ -14,7 +14,7 @@ import { schema } from "@/zero/schema";
const cacheURL = process.env.NEXT_PUBLIC_ZERO_CACHE_URL || "http://localhost:4848";
function ZeroAuthGuard({ children }: { children: React.ReactNode }) {
function ZeroAuthSync() {
const zero = useZero();
const connectionState = useConnectionState();
const isRefreshingRef = useRef(false);
@ -37,7 +37,7 @@ function ZeroAuthGuard({ children }: { children: React.ReactNode }) {
});
}, [connectionState, zero]);
return <>{children}</>;
return null;
}
export function ZeroProvider({ children }: { children: React.ReactNode }) {
@ -59,7 +59,8 @@ export function ZeroProvider({ children }: { children: React.ReactNode }) {
return (
<ZeroReactProvider {...opts}>
{hasUser ? <ZeroAuthGuard>{children}</ZeroAuthGuard> : children}
{hasUser && <ZeroAuthSync />}
{children}
</ZeroReactProvider>
);
}