mirror of
https://github.com/neynarxyz/create-farcaster-mini-app.git
synced 2025-12-07 01:42:31 -05:00
feat: update constant writes
This commit is contained in:
@@ -5,6 +5,7 @@ import type { Session } from "next-auth";
|
||||
import { SessionProvider } from "next-auth/react";
|
||||
import { MiniAppProvider } from "@neynar/react";
|
||||
import { SafeFarcasterSolanaProvider } from "~/components/providers/SafeFarcasterSolanaProvider";
|
||||
import { ANALYTICS_ENABLED } from "~/lib/constants";
|
||||
|
||||
const WagmiProvider = dynamic(
|
||||
() => import("~/components/providers/WagmiProvider"),
|
||||
@@ -18,7 +19,7 @@ export function Providers({ session, children }: { session: Session | null, chil
|
||||
return (
|
||||
<SessionProvider session={session}>
|
||||
<WagmiProvider>
|
||||
<MiniAppProvider analyticsEnabled={true} backButtonEnabled={true}>
|
||||
<MiniAppProvider analyticsEnabled={ANALYTICS_ENABLED} backButtonEnabled={true}>
|
||||
<SafeFarcasterSolanaProvider endpoint={solanaEndpoint}>
|
||||
{children}
|
||||
</SafeFarcasterSolanaProvider>
|
||||
|
||||
@@ -157,19 +157,6 @@ export function WalletTab() {
|
||||
} = useSwitchChain();
|
||||
|
||||
// --- Effects ---
|
||||
/**
|
||||
* Debug logging for wallet auto-connection and state changes.
|
||||
* Logs context, connection status, address, and available connectors.
|
||||
*/
|
||||
useEffect(() => {
|
||||
console.log("WalletTab Debug Info:");
|
||||
console.log("- context:", context);
|
||||
console.log("- isConnected:", isConnected);
|
||||
console.log("- address:", address);
|
||||
console.log("- connectors:", connectors);
|
||||
console.log("- context?.user:", context?.user);
|
||||
}, [context, isConnected, address, connectors]);
|
||||
|
||||
/**
|
||||
* Auto-connect when Farcaster context is available.
|
||||
*
|
||||
|
||||
@@ -90,3 +90,12 @@ export const APP_WEBHOOK_URL = process.env.NEYNAR_API_KEY && process.env.NEYNAR_
|
||||
* Useful for mini apps that don't require wallet integration.
|
||||
*/
|
||||
export const USE_WALLET = true;
|
||||
|
||||
/**
|
||||
* Flag to enable/disable analytics tracking.
|
||||
*
|
||||
* When true, usage analytics are collected and sent to Neynar.
|
||||
* When false, analytics collection is disabled.
|
||||
* Useful for privacy-conscious users or development environments.
|
||||
*/
|
||||
export const ANALYTICS_ENABLED = true;
|
||||
|
||||
Reference in New Issue
Block a user