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

Main backmergde #4565

Merged
merged 2 commits into from
Dec 29, 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
14 changes: 0 additions & 14 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,6 @@ const SECURITY_HEADERS = [
const nextConfig = removeImports({
experimental: {
esmExternals: true,
optimizePackageImports: [
'juice-sdk-core',
'juice-sdk-react',
'ethers',
'ethers/lib/utils',
'@ethersproject/constants',
'@ethersproject/bignumber',
'@ethersproject',
'viem',
'viem/chains',
'wagmi',
'@wagmi/core',
'@heroicons/react'
],
},
staticPageGenerationTimeout: 90,
webpack: config => {
Expand Down
21 changes: 17 additions & 4 deletions src/packages/v2v3/utils/distributions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ export function ensureSplitsSumTo100Percent({
return adjustedSplits
}

export function roundSplitPercents({ splits }: { splits: Split[]}) {
return splits.map((split) => {
export function roundSplitPercents({ splits }: { splits: Split[] }) {
return splits.map(split => {
return {
...split,
percent: Math.round(split.percent),
Expand Down Expand Up @@ -183,7 +183,7 @@ export function adjustedSplitPercents({
amount: currentAmount,
distributionLimit: parseFloat(newDistributionLimit),
})

const adjustedSplit = {
beneficiary: split.beneficiary,
percent: newPercent,
Expand Down Expand Up @@ -269,5 +269,18 @@ export function distributionLimitsEqual(
) {
return true
}
return distributionLimit1?.eq(distributionLimit2 ?? 0)

// get around limitation of BigNumber comparison, where one value can't be undefined
if (
(typeof distributionLimit1 === 'undefined' && distributionLimit2) ||
(typeof distributionLimit2 === 'undefined' && distributionLimit1)
) {
return false
}

if (distributionLimit1 && distributionLimit2) {
return distributionLimit1.eq(distributionLimit2 ?? null)
}

return false
}
4 changes: 2 additions & 2 deletions src/utils/server/pages/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getProjectMetadata } from '../metadata'
export interface ProjectPageProps {
metadata?: ProjectMetadata
projectId: number
chainName?: string
chainName?: string | null
}

export async function getProjectStaticProps(
Expand All @@ -25,7 +25,7 @@ export async function getProjectStaticProps(
props: {
metadata,
projectId,
chainName,
chainName: chainName ?? null,
},
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
Loading