mirror of
https://github.com/neynarxyz/create-farcaster-mini-app.git
synced 2025-12-10 03:12:34 -05:00
Revert "Merge pull request #15 from neynarxyz/shreyas-formatting"
This reverts commitb1fdfc19a9, reversing changes made tob9e2087bd8.
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
import React, { createContext, useEffect, useState } from 'react';
|
||||
import dynamic from 'next/dynamic';
|
||||
import React, { createContext, useEffect, useState } from "react";
|
||||
import dynamic from "next/dynamic";
|
||||
import { sdk } from '@farcaster/miniapp-sdk';
|
||||
|
||||
const FarcasterSolanaProvider = dynamic(
|
||||
() =>
|
||||
import('@farcaster/mini-app-solana').then(
|
||||
mod => mod.FarcasterSolanaProvider,
|
||||
),
|
||||
{ ssr: false },
|
||||
() => import('@farcaster/mini-app-solana').then(mod => mod.FarcasterSolanaProvider),
|
||||
{ ssr: false }
|
||||
);
|
||||
|
||||
type SafeFarcasterSolanaProviderProps = {
|
||||
@@ -15,15 +12,10 @@ type SafeFarcasterSolanaProviderProps = {
|
||||
children: React.ReactNode;
|
||||
};
|
||||
|
||||
const SolanaProviderContext = createContext<{ hasSolanaProvider: boolean }>({
|
||||
hasSolanaProvider: false,
|
||||
});
|
||||
const SolanaProviderContext = createContext<{ hasSolanaProvider: boolean }>({ hasSolanaProvider: false });
|
||||
|
||||
export function SafeFarcasterSolanaProvider({
|
||||
endpoint,
|
||||
children,
|
||||
}: SafeFarcasterSolanaProviderProps) {
|
||||
const isClient = typeof window !== 'undefined';
|
||||
export function SafeFarcasterSolanaProvider({ endpoint, children }: SafeFarcasterSolanaProviderProps) {
|
||||
const isClient = typeof window !== "undefined";
|
||||
const [hasSolanaProvider, setHasSolanaProvider] = useState<boolean>(false);
|
||||
const [checked, setChecked] = useState<boolean>(false);
|
||||
|
||||
@@ -56,8 +48,8 @@ export function SafeFarcasterSolanaProvider({
|
||||
const origError = console.error;
|
||||
console.error = (...args) => {
|
||||
if (
|
||||
typeof args[0] === 'string' &&
|
||||
args[0].includes('WalletConnectionError: could not get Solana provider')
|
||||
typeof args[0] === "string" &&
|
||||
args[0].includes("WalletConnectionError: could not get Solana provider")
|
||||
) {
|
||||
if (!errorShown) {
|
||||
origError(...args);
|
||||
|
||||
Reference in New Issue
Block a user