@@ -35,6 +35,7 @@ export interface VaultOverviewContextType {
3535 collateral : string ;
3636 pendingUnlockEth : string ;
3737 } ;
38+ isLoadingVault ?: boolean ;
3839 getVaultDataToRender : (
3940 payload : SectionPayload [ ] ,
4041 ) => ( SectionPayload & { payload : string | Address } ) [ ] ;
@@ -46,6 +47,7 @@ export type SectionPayload = {
4647 key : VaultOverviewContextKeys ;
4748 actionText ?: string ;
4849 actionLink ?: string ;
50+ isLoading ?: boolean ;
4951} ;
5052
5153const VaultOverviewContext = createContext < VaultOverviewContextType | null > (
@@ -56,7 +58,7 @@ const toEthValue = (value: bigint) => `${formatBalance(value).trimmed} ETH`;
5658const toStethValue = ( value : bigint ) => `${ formatBalance ( value ) . trimmed } stETH` ;
5759
5860export const VaultOverviewProvider : FC < PropsWithChildren > = ( { children } ) => {
59- const { activeVault } = useVaultInfo ( ) ;
61+ const { activeVault, isLoadingVault } = useVaultInfo ( ) ;
6062
6163 const values : VaultOverviewContextType [ 'values' ] = useMemo ( ( ) => {
6264 if ( activeVault ) {
@@ -130,19 +132,24 @@ export const VaultOverviewProvider: FC<PropsWithChildren> = ({ children }) => {
130132 nodeOperatorFee,
131133 collateral,
132134 pendingUnlockEth,
135+ isLoadingVault,
133136 } ;
134137 }
135138
136139 return { } as VaultOverviewContextType [ 'values' ] ;
137- } , [ activeVault ] ) ;
140+ } , [ activeVault , isLoadingVault ] ) ;
138141
139142 const getVaultDataToRender = useCallback (
140143 ( sectionPayloadList : SectionPayload [ ] ) => {
141144 return sectionPayloadList . map ( ( item ) => {
142- return { ...item , payload : values [ item . key ] } ;
145+ return {
146+ ...item ,
147+ payload : values [ item . key ] ,
148+ isLoading : isLoadingVault ,
149+ } ;
143150 } ) ;
144151 } ,
145- [ values ] ,
152+ [ values , isLoadingVault ] ,
146153 ) ;
147154
148155 return (
0 commit comments