From defa6dfbd0edc744e5674d240080543b5519e9ee Mon Sep 17 00:00:00 2001 From: Joel Jeremy Marquez Date: Thu, 27 Feb 2025 15:09:26 -0800 Subject: [PATCH] Use ID as key --- .../src/components/mobile/accounts/Accounts.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/desktop-client/src/components/mobile/accounts/Accounts.tsx b/packages/desktop-client/src/components/mobile/accounts/Accounts.tsx index e175a0296d0..8ae2b8cc1fd 100644 --- a/packages/desktop-client/src/components/mobile/accounts/Accounts.tsx +++ b/packages/desktop-client/src/components/mobile/accounts/Accounts.tsx @@ -324,6 +324,7 @@ function AccountList({ const accountListData = useListData({ initialItems: accounts, + getKey: account => account.id, }); const { dragAndDropHooks } = useDragAndDrop({ @@ -332,8 +333,8 @@ function AccountList({ 'text/plain': accountListData.getItem(key).id, })), onReorder(e) { - const accountIdToMove = accountListData.getItem(e.keys[0]).id; - const targetAccountId = accountListData.getItem(e.target.key).id; + const accountIdToMove = e.keys[0] as AccountEntity['id']; + const targetAccountId = e.target.key as AccountEntity['id']; if (e.target.dropPosition === 'before') { accountListData.moveBefore(e.target.key, e.keys);