satisfy linting errors
This commit is contained in:
parent
f0fe137e26
commit
5eff6011d8
|
@ -3,7 +3,7 @@ import BN from 'bn.js'
|
|||
import useWalletStore from '../stores/useWalletStore'
|
||||
|
||||
const Balances = () => {
|
||||
var { tokenAccounts, mints } = useWalletStore((state) => state)
|
||||
const { tokenAccounts, mints } = useWalletStore((state) => state)
|
||||
|
||||
function fixedPointToNumber(value: BN, decimals: number) {
|
||||
const divisor = new BN(10).pow(new BN(decimals))
|
||||
|
|
|
@ -6,10 +6,7 @@ import {
|
|||
ChevronDownIcon,
|
||||
DuplicateIcon,
|
||||
LogoutIcon,
|
||||
MenuIcon,
|
||||
XIcon,
|
||||
} from '@heroicons/react/outline'
|
||||
import { useRouter } from 'next/router'
|
||||
import ConnectWalletButton from './ConnectWalletButton'
|
||||
import WalletIcon from './WalletIcon'
|
||||
import useWalletStore from '../stores/useWalletStore'
|
||||
|
@ -27,7 +24,6 @@ const WALLET_OPTIONS = [
|
|||
]
|
||||
|
||||
const TopBar = () => {
|
||||
const { asPath } = useRouter()
|
||||
const { connected, current: wallet } = useWalletStore((s) => s)
|
||||
const [isCopied, setIsCopied] = useState(false)
|
||||
|
||||
|
|
|
@ -56,7 +56,6 @@ export default function useWallet() {
|
|||
)
|
||||
|
||||
useEffect(() => {
|
||||
console.log('provider url changed', selectedProviderUrl)
|
||||
if (selectedProviderUrl) {
|
||||
setSavedProviderUrl(selectedProviderUrl)
|
||||
}
|
||||
|
@ -66,7 +65,6 @@ export default function useWallet() {
|
|||
if (provider) {
|
||||
const updateWallet = () => {
|
||||
// hack to also update wallet synchronously in case it disconnects
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const wallet = new (provider.adapter || Wallet)(
|
||||
savedProviderUrl,
|
||||
endpoint
|
||||
|
|
|
@ -11,7 +11,7 @@ interface NotificationStore extends State {
|
|||
set: (x: any) => void
|
||||
}
|
||||
|
||||
const useNotificationStore = create<NotificationStore>((set, get) => ({
|
||||
const useNotificationStore = create<NotificationStore>((set, _get) => ({
|
||||
notifications: [],
|
||||
set: (fn) => set(produce(fn)),
|
||||
}))
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import create, { State } from 'zustand'
|
||||
import produce from 'immer'
|
||||
import { Connection, PublicKey } from '@solana/web3.js'
|
||||
import { Connection } from '@solana/web3.js'
|
||||
|
||||
import { EndpointInfo, WalletAdapter } from '../@types/types'
|
||||
import {
|
||||
|
@ -84,11 +84,10 @@ const useWalletStore = create<WalletStore>((set, get) => ({
|
|||
const connection = get().connection.current
|
||||
const connected = get().connected
|
||||
const tokenAccounts = get().tokenAccounts
|
||||
const mints = get().mints
|
||||
const set = get().set
|
||||
|
||||
if (connected) {
|
||||
var fetchMints = tokenAccounts.map((a) =>
|
||||
const fetchMints = tokenAccounts.map((a) =>
|
||||
getMint(connection, a.account.mint)
|
||||
)
|
||||
const mintResults = await Promise.all(fetchMints)
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import React from 'react'
|
||||
import { render, fireEvent } from '../testUtils'
|
||||
import { render } from '../testUtils'
|
||||
import Home from '../../pages/index'
|
||||
|
||||
describe('Home page', () => {
|
||||
it('renders', () => {
|
||||
const { asFragment } = render(<Home />, {})
|
||||
render(<Home />, {})
|
||||
expect(true).toBe(true)
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Connection, ParsedAccountData, PublicKey } from '@solana/web3.js'
|
||||
import { Connection, PublicKey } from '@solana/web3.js'
|
||||
import {
|
||||
AccountInfo,
|
||||
AccountLayout,
|
||||
|
|
|
@ -8,7 +8,9 @@ export function SolletExtensionAdapter(_, network) {
|
|||
}
|
||||
|
||||
return {
|
||||
on: () => {},
|
||||
on: () => {
|
||||
/* do nothing */
|
||||
},
|
||||
connect: () => {
|
||||
notify({
|
||||
message: 'Sollet Extension Error',
|
||||
|
|
Loading…
Reference in New Issue