Skip to content

Commit

Permalink
feat: clear asset list when query is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
kieranroneill committed Dec 26, 2023
1 parent 47a0dec commit 0857d53
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/extension/modals/AddAssetModal/AddAssetModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,12 @@ const AddAssetModal: FC<IProps> = ({ onClose }: IProps) => {
onClose();
};
const handleKeyUp = () => {
if (account && query.length > 0) {
// if the query is empty, clear assets
if (query.length <= 0) {
dispatch(clearAssets());
}

if (account) {
// abort the previous standard assets request
if (queryStandardAssetDispatch) {
queryStandardAssetDispatch.abort();
Expand Down

0 comments on commit 0857d53

Please sign in to comment.