File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
src/components/pages/vaults
components/widget/deposit Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff 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+
117131const 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 ,
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments