Skip to content

Commit

Permalink
fix infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Tbaut committed Aug 19, 2024
1 parent 239e7ea commit be5c851
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
25 changes: 15 additions & 10 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import './index.css'
import { Content } from './Content'
import 'dot-connect/font.css'
import { config } from './walletConfigs'
import { ReDotProvider } from '@reactive-dot/react'
import { ReDotProvider, ReDotChainProvider } from '@reactive-dot/react'
import { Suspense } from 'react'

const App = () => {
const [settings] = useLocalStorage('fellowship-settings', {
Expand All @@ -19,15 +20,19 @@ const App = () => {
<>
<ThemeProvider defaultTheme={settings?.themeMode as Theme}>
<ReDotProvider config={config}>
<TooltipProvider>
<div className="flex min-h-screen w-full flex-col bg-muted/40">
<Navigation />
<div className="flex flex-col sm:gap-4 sm:py-4 sm:pl-14">
<Header />
<Content />
</div>
</div>
</TooltipProvider>
<ReDotChainProvider chainId="polkadot">
<Suspense>
<TooltipProvider>
<div className="flex min-h-screen w-full flex-col bg-muted/40">
<Navigation />
<div className="flex flex-col sm:gap-4 sm:py-4 sm:pl-14">
<Header />
<Content />
</div>
</div>
</TooltipProvider>
</Suspense>
</ReDotChainProvider>
</ReDotProvider>
</ThemeProvider>
<Toaster />
Expand Down
9 changes: 0 additions & 9 deletions src/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { Button } from '@/components/ui/button'
import { routes } from '@/lib/utils'

import { Settings2, PanelLeft } from 'lucide-react'
// import { useAccounts } from '@reactive-dot/react'

import {
Menubar,
Expand All @@ -25,14 +24,6 @@ import {
} from '@/components/ui/menubar'

export const Header = () => {
// const accounts = useAccounts()
// Error: No chain ID provided

// const accounts = useAccounts({ chainId: 'polkadot' })

// console.log('accounts', accounts)
// getting infinite loop, although it's a working rpc
// Unable to connect to wss://dot-rpc.stakeworld.io ws-provider.ts:18:18
return (
<header className="sticky top-0 z-30 flex h-14 items-center gap-4 border-b bg-background px-4 sm:sticky sm:h-auto sm:border-0 sm:bg-transparent sm:px-6">
<Sheet>
Expand Down

0 comments on commit be5c851

Please sign in to comment.