Skip to content

Commit

Permalink
fix: can unselect stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Oct 10, 2023
1 parent b2ce5a7 commit 9e919ed
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 18 deletions.
11 changes: 0 additions & 11 deletions apps/common/components/MultiSelectDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,6 @@ export function MultiSelectDropdown({options, onSelect, placeholder = ''}: TMult
set_areAllSelected(!currentState.some((option): boolean => !option.isSelected));
}

// if none are selected in currentState, then select all
if (!currentState.some((option): boolean => option.isSelected)) {
currentState = currentOptions.map((option): TMultiSelectOptionProps => {
return {
...option,
isSelected: true
};
});
set_areAllSelected(true);
}

set_currentOptions(currentState);
onSelect(currentState);
}}
Expand Down
1 change: 0 additions & 1 deletion apps/common/schemas/yDaemonVaultsSchemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ export const yDaemonVaultSchema = z.object({
}),
featuringScore: z.number().default(0).catch(0),
retired: z.boolean().default(false).catch(false),
depositLimit: z.string(),
strategies: z.array(yDaemonVaultStrategySchema).nullable().default([]),
migration: z.object({
available: z.boolean(),
Expand Down
4 changes: 3 additions & 1 deletion apps/vaults/components/list/VaultsListEmpty.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ export function VaultsListEmpty({
) : (
<>
<p className={'text-center text-neutral-600'}>
{`There doesn’t seem to be anything here. It might be because you searched for a token in the ${currentCategory} category, or because there’s a rodent infestation in our server room. You check the search box, we’ll check the rodents. Deal?`}
{currentCategory.length === 0 || currentCategory === '[]'
? `There doesn’t seem to be anything here. It might be because you selected no filters, or because there’s a rodent infestation in our server room. You check the filters, we’ll check the rodents. Deal?`
: `There doesn’t seem to be anything here. It might be because you searched for a token in the ${currentCategory} category, or because there’s a rodent infestation in our server room. You check the search box, we’ll check the rodents. Deal?`}
</p>
<Button
className={'w-full md:w-48'}
Expand Down
7 changes: 3 additions & 4 deletions apps/vaults/contexts/useActionFlow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,9 @@ export function ActionFlowContextApp({children, currentVault}: {children: ReactN
}).raw;
let _amount = toNormalizedBN(userBalance, _selectedFrom?.decimals || currentVault?.token?.decimals || 18);
if (isDepositing) {
const vaultDepositLimit = toBigInt(currentVault?.depositLimit);
if (_selectedFrom?.value === currentVault?.token?.address) {
if (userBalance > vaultDepositLimit) {
_amount = toNormalizedBN(vaultDepositLimit, currentVault.token.decimals);
if (userBalance > toBigInt(depositLimit)) {
_amount = toNormalizedBN(toBigInt(depositLimit), currentVault.token.decimals);
}
}
}
Expand All @@ -410,7 +409,7 @@ export function ActionFlowContextApp({children, currentVault}: {children: ReactN
}
});
},
[getBalance, currentVault.depositLimit, currentVault.token?.address, currentVault.token.decimals, isDepositing]
[getBalance, currentVault.token?.address, currentVault.token.decimals, isDepositing]
);

/* 🔵 - Yearn Finance **************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@rainbow-me/rainbowkit": "1.0.11",
"@wagmi/chains": "1.8.0",
"@wagmi/core": "1.4.1",
"@yearn-finance/web-lib": "3.0.41",
"@yearn-finance/web-lib": "3.0.43",
"axios": "^1.5.0",
"dayjs": "^1.11.9",
"eslint-config-prettier": "^9.0.0",
Expand Down

0 comments on commit 9e919ed

Please sign in to comment.