Skip to content

Commit

Permalink
Move account in DB
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-jeremy committed Feb 27, 2025
1 parent 8919bd8 commit 4254a54
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { TextOneLine } from '@actual-app/components/text-one-line';
import { View } from '@actual-app/components/view';
import { css } from '@emotion/css';

import { moveAccount } from 'loot-core/client/accounts/accountsSlice';
import { replaceModal } from 'loot-core/client/actions';
import { syncAndDownload } from 'loot-core/client/app/appSlice';
import * as queries from 'loot-core/client/queries';
Expand Down Expand Up @@ -319,6 +320,7 @@ function AccountList({
const failedAccounts = useFailedAccounts();
const syncingAccountIds = useSelector(state => state.account.accountsSyncing);
const updatedAccounts = useSelector(state => state.queries.updatedAccounts);
const dispatch = useDispatch();

const accountListData = useListData({
initialItems: accounts,
Expand All @@ -332,8 +334,20 @@ function AccountList({
onReorder(e) {
if (e.target.dropPosition === 'before') {
accountListData.moveBefore(e.target.key, e.keys);
dispatch(
moveAccount({
id: e.keys[0] as string,

Check failure on line 339 in packages/desktop-client/src/components/mobile/accounts/Accounts.tsx

View workflow job for this annotation

GitHub Actions / typecheck

Element implicitly has an 'any' type because expression of type '0' can't be used to index type 'Set<Key>'.
targetId: e.target.key as string,
}),
);
} else if (e.target.dropPosition === 'after') {
accountListData.moveAfter(e.target.key, e.keys);
dispatch(
moveAccount({
id: e.target.key as string,
targetId: e.keys[0] as string,

Check failure on line 348 in packages/desktop-client/src/components/mobile/accounts/Accounts.tsx

View workflow job for this annotation

GitHub Actions / typecheck

Element implicitly has an 'any' type because expression of type '0' can't be used to index type 'Set<Key>'.
}),
);
}
},
});
Expand Down

0 comments on commit 4254a54

Please sign in to comment.