Skip to content

Commit d794b36

Browse files
rossgalloway0xeye
authored andcommitted
chore: fix review comments (#1084)
1 parent 7cf7e69 commit d794b36

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/components/pages/vaults/[chainID]/[address].tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,20 @@ const splitFirstSentence = (message: string): { title: string; body?: string } =
114114
return body ? { title, body } : { title }
115115
}
116116

117+
const isSnapshotLikelyV3Vault = (snapshot: TKongVaultSnapshot): boolean => {
118+
const apiVersion = snapshot.apiVersion ?? ''
119+
if (apiVersion.startsWith('3') || apiVersion.startsWith('~3')) {
120+
return true
121+
}
122+
123+
const normalizedKind = snapshot.meta?.kind?.toLowerCase() ?? ''
124+
if (normalizedKind === 'single strategy' || normalizedKind === 'multi strategy') {
125+
return true
126+
}
127+
128+
return (snapshot.composition?.length ?? 0) > 0 || (snapshot.strategies?.length ?? 0) > 0
129+
}
130+
117131
const buildSnapshotBackedVault = (snapshot: TKongVaultSnapshot): TKongVault => {
118132
const token = snapshot.meta?.token
119133
const asset = snapshot.asset
@@ -146,7 +160,7 @@ const buildSnapshotBackedVault = (snapshot: TKongVaultSnapshot): TKongVault => {
146160
category: snapshot.meta?.category ?? null,
147161
type: snapshot.meta?.type ?? null,
148162
kind: snapshot.meta?.kind ?? null,
149-
v3: snapshot.apiVersion?.startsWith('3') ?? false,
163+
v3: isSnapshotLikelyV3Vault(snapshot),
150164
yearn: true,
151165
isRetired: snapshot.meta?.isRetired ?? false,
152166
isHidden: snapshot.meta?.isHidden ?? false,

src/components/pages/vaults/components/widget/deposit/useDepositError.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ export const useDepositError = ({
4646
}
4747

4848
// Route-dependent validation - wait for debounce and route fetch
49+
if (routeType === 'NO_ROUTE' && debouncedAmount > 0n && !isDebouncing) {
50+
return 'No route available for selected token'
51+
}
52+
4953
if (routeType === 'ENSO' && flowError && !isLoadingRoute && debouncedAmount > 0n && !isDebouncing) {
5054
return 'Unable to find route'
5155
}

0 commit comments

Comments
 (0)