diff --git a/packages/desktop-client/src/components/modals/ConfirmCategoryDelete.js b/packages/desktop-client/src/components/modals/ConfirmCategoryDelete.js index 9c717426ccd154aa4cc5f870aa2e8a27c618830a..ae4b5b80267e82e820055ce69d96b5964437819d 100644 --- a/packages/desktop-client/src/components/modals/ConfirmCategoryDelete.js +++ b/packages/desktop-client/src/components/modals/ConfirmCategoryDelete.js @@ -69,7 +69,20 @@ export default function ConfirmCategoryDelete({ <View style={{ flex: 1, marginLeft: 10, marginRight: 30 }}> <CategoryAutocomplete - categoryGroups={categoryGroups} + categoryGroups={ + group + ? categoryGroups.filter( + g => g.id !== group.id && !!g.is_income === isIncome, + ) + : categoryGroups + .filter(g => !!g.is_income === isIncome) + .map(g => ({ + ...g, + categories: g.categories.filter( + c => c.id !== category.id, + ), + })) + } value={transferCategory} inputProps={{ placeholder: 'Select category...', diff --git a/upcoming-release-notes/1351.md b/upcoming-release-notes/1351.md new file mode 100644 index 0000000000000000000000000000000000000000..b16dabf45b0fd3bd84a2c615e0fb0f0b34382cb8 --- /dev/null +++ b/upcoming-release-notes/1351.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [aleetsaiya] +--- + +Fix a bug that user can transfer budget to the category (or group) which user want to delete \ No newline at end of file