Skip to content

Commit

Permalink
fix: resetAfterIndex after deleting address (#1748)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmy147 authored Sep 15, 2023
1 parent fb12117 commit cfdebd0
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions src/ui/views/AddressManagement/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,10 @@ const AddressManagement = () => {
[filteredAccounts, sortedAccountsList, addressSortStore.sortType]
);

useEffect(() => {
listRef.current?.resetAfterIndex(0);
}, [accountsList.length]);

return (
<div className="page-address-management px-0 overflow-hidden">
<PageHeader className="pt-[24px] mx-[20px]">
Expand Down Expand Up @@ -542,21 +546,21 @@ const AddressManagement = () => {
)}
</AddressItem>
</div>
<div className="flex justify-between items-center text-gray-subTitle text-13 px-20 py-16">
<SortInput
value={searchKeyword}
onChange={(e) => setSearchKeyword(e.target.value)}
/>
<div
className="flex items-center cursor-pointer"
onClick={gotoManageAddress}
>
<span>{t('page.manageAddress.manage-address')}</span>
<IconRight />
</div>
</div>
</>
)}
<div className="flex justify-between items-center text-gray-subTitle text-13 px-20 py-16">
<SortInput
value={searchKeyword}
onChange={(e) => setSearchKeyword(e.target.value)}
/>
<div
className="flex items-center cursor-pointer"
onClick={gotoManageAddress}
>
<span>{t('page.manageAddress.manage-address')}</span>
<IconRight />
</div>
</div>
{noAnyAccount ? (
<NoAddressUI />
) : noAnySearchedAccount ? (
Expand Down

0 comments on commit cfdebd0

Please sign in to comment.