mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-12 01:02:39 +02:00
feat: integrate Stripe for page purchases and reconciliation tasks
This commit is contained in:
parent
17642493eb
commit
a9fd45844d
31 changed files with 1948 additions and 166 deletions
|
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue