Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build #377

Merged
merged 1 commit into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/components/Claim/useClaimLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ export const useClaimLink = () => {
try {
await switchNetworkUtil({
chainId,
currentChainId: currentChain?.id,
currentChainId: String(currentChain?.id),
setLoadingState,
switchChainAsync,
switchChainAsync: async ({ chainId }) => {
await switchChainAsync({ chainId: chainId as number });
},
})
console.log(`Switched to chain ${chainId}`)
} catch (error) {
Expand Down
6 changes: 4 additions & 2 deletions src/components/Create/useCreateLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,11 @@ export const useCreateLink = () => {
try {
await switchNetworkUtil({
chainId,
currentChainId: currentChain?.id,
currentChainId: String(currentChain?.id),
setLoadingState,
switchChainAsync,
switchChainAsync: async ({ chainId }) => {
await switchChainAsync({ chainId: chainId as number });
},
})
console.log(`Switched to chain ${chainId}`)
} catch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const AdvancedTokenSelectorButton = ({
))}
{tokenAmount && tokenPrice && (
<p className="text-xs text-gray-1">
${utils.formatTokenAmount(Number(tokenAmount ?? 0) * tokenPrice ?? 0, 4)}
${utils.formatTokenAmount(Number(tokenAmount) * tokenPrice, 4)}
</p>
)}
</div>
Expand Down
12 changes: 7 additions & 5 deletions src/components/Request/Pay/Views/Initial.view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { peanut } from '@squirrel-labs/peanut-sdk'
import TokenSelector from '@/components/Global/TokenSelector/TokenSelector'
import { switchNetwork as switchNetworkUtil } from '@/utils/general.utils'
import { ADDRESS_ZERO, EPeanutLinkType } from '../utils'
import { ethers } from 'ethersv5'
import { ethers } from 'ethers'

export const InitialView = ({
onNext,
Expand Down Expand Up @@ -74,9 +74,11 @@ export const InitialView = ({
try {
await switchNetworkUtil({
chainId,
currentChainId: currentChain?.id,
currentChainId: String(currentChain?.id),
setLoadingState,
switchChainAsync,
switchChainAsync: async ({ chainId }) => {
await switchChainAsync({ chainId: chainId as number });
},
})
console.log(`Switched to chain ${chainId}`)
} catch (error) {
Expand All @@ -85,7 +87,7 @@ export const InitialView = ({
}

const handleOnNext = async () => {
if (selectedChainID !== currentChain) {
if (selectedChainID !== String(currentChain?.id)) {
await switchNetwork(selectedChainID)
}
try {
Expand Down Expand Up @@ -265,7 +267,7 @@ export const InitialView = ({
requestLinkData.tokenAddress === selectedTokenAddress ? (
<MoreInfo
text={
estimatedGasCost > 0
estimatedGasCost && estimatedGasCost > 0
? `This transaction will cost you $${utils.formatTokenAmount(estimatedGasCost, 3)} in network fees.`
: 'This transaction is sponsored by peanut! Enjoy!'
}
Expand Down