Skip to content

Commit

Permalink
chore: misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rossbulat committed Jan 4, 2025
1 parent 83a3f72 commit 3193476
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
4 changes: 1 addition & 3 deletions packages/app/src/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { PagesConfig } from 'config/pages'
import { useActiveAccounts } from 'contexts/ActiveAccounts'
import { useNetwork } from 'contexts/Network'
import { usePlugins } from 'contexts/Plugins'
import { useStaking } from 'contexts/Staking'
import { useUi } from 'contexts/UI'
import { useAccountFromUrl } from 'hooks/useAccountFromUrl'
import { ErrorFallbackApp, ErrorFallbackRoutes } from 'library/ErrorBoundary'
Expand Down Expand Up @@ -34,7 +33,6 @@ import { Body, Main } from 'ui-core/base'

const RouterInner = () => {
const { network } = useNetwork()
const { inSetup } = useStaking()
const { pathname } = useLocation()
const { setContainerRefs } = useUi()
const { pluginEnabled } = usePlugins()
Expand All @@ -60,7 +58,7 @@ const RouterInner = () => {

return (
<ErrorBoundary FallbackComponent={ErrorFallbackApp}>
{pluginEnabled('staking_api') && !inSetup() && activeAccount && (
{pluginEnabled('staking_api') && activeAccount && (
<StakingApi activeAccount={activeAccount} network={network} />
)}
<NotificationPrompts />
Expand Down
1 change: 0 additions & 1 deletion packages/app/src/StakingApi/UnclaimedRewardsApi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import type { Props } from './types'
export const UnclaimedRewardsApi = ({ activeAccount, network }: Props) => {
const { activeEra } = useApi()
const { setUnclaimedRewards } = usePayouts()

const { data, loading, error } = useUnclaimedRewards({
chain: network,
who: activeAccount,
Expand Down
9 changes: 4 additions & 5 deletions packages/app/src/contexts/Payouts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import type { UnclaimedRewards } from 'plugin-staking-api/types'
import type { ReactNode } from 'react'
import { createContext, useContext, useState } from 'react'
import { defaultPayoutsContext } from './defaults'
import { defaultPayoutsContext, defaultUnclaimedRewards } from './defaults'
import type { PayoutsContextInterface } from './types'

export const PayoutsContext = createContext<PayoutsContextInterface>(
Expand All @@ -14,10 +14,9 @@ export const PayoutsContext = createContext<PayoutsContextInterface>(
export const usePayouts = () => useContext(PayoutsContext)

export const PayoutsProvider = ({ children }: { children: ReactNode }) => {
const [unclaimedRewards, setUnclaimedRewards] = useState<UnclaimedRewards>({
total: '0',
entries: [],
})
const [unclaimedRewards, setUnclaimedRewards] = useState<UnclaimedRewards>(
defaultUnclaimedRewards
)

return (
<PayoutsContext.Provider
Expand Down

0 comments on commit 3193476

Please sign in to comment.