mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-09 03:32:54 -05:00
* Fix no dismissal on budget action * Add release notes file * Correct tag * Remove unnecessary callback * Linting * Apply same strategy on reportcomponents * Rename to onMenuAction
This commit is contained in:
@@ -163,6 +163,12 @@ export const CategoryMonth = memo(function CategoryMonth({
|
||||
const [balanceMenuOpen, setBalanceMenuOpen] = useState(false);
|
||||
const triggerBalanceMenuRef = useRef(null);
|
||||
|
||||
const onMenuAction = (...args: Parameters<typeof onBudgetAction>) => {
|
||||
onBudgetAction(...args);
|
||||
setBalanceMenuOpen(false);
|
||||
setMenuOpen(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<View
|
||||
style={{
|
||||
@@ -225,10 +231,9 @@ export const CategoryMonth = memo(function CategoryMonth({
|
||||
>
|
||||
<BudgetMenu
|
||||
onCopyLastMonthAverage={() => {
|
||||
onBudgetAction?.(month, 'copy-single-last', {
|
||||
onMenuAction(month, 'copy-single-last', {
|
||||
category: category.id,
|
||||
});
|
||||
setMenuOpen(false);
|
||||
}}
|
||||
onSetMonthsAverage={numberOfMonths => {
|
||||
if (
|
||||
@@ -239,16 +244,14 @@ export const CategoryMonth = memo(function CategoryMonth({
|
||||
return;
|
||||
}
|
||||
|
||||
onBudgetAction?.(month, `set-single-${numberOfMonths}-avg`, {
|
||||
onMenuAction(month, `set-single-${numberOfMonths}-avg`, {
|
||||
category: category.id,
|
||||
});
|
||||
setMenuOpen(false);
|
||||
}}
|
||||
onApplyBudgetTemplate={() => {
|
||||
onBudgetAction?.(month, 'apply-single-category-template', {
|
||||
onMenuAction(month, 'apply-single-category-template', {
|
||||
category: category.id,
|
||||
});
|
||||
setMenuOpen(false);
|
||||
}}
|
||||
/>
|
||||
</Popover>
|
||||
@@ -351,11 +354,10 @@ export const CategoryMonth = memo(function CategoryMonth({
|
||||
<BalanceMenu
|
||||
categoryId={category.id}
|
||||
onCarryover={carryover => {
|
||||
onBudgetAction?.(month, 'carryover', {
|
||||
onMenuAction(month, 'carryover', {
|
||||
category: category.id,
|
||||
flag: carryover,
|
||||
});
|
||||
setBalanceMenuOpen(false);
|
||||
}}
|
||||
/>
|
||||
</Popover>
|
||||
|
||||
@@ -158,6 +158,11 @@ export const ExpenseCategoryMonth = memo(function ExpenseCategoryMonth({
|
||||
const [balanceMenuOpen, setBalanceMenuOpen] = useState(false);
|
||||
const [hover, setHover] = useState(false);
|
||||
|
||||
const onMenuAction = (...args: Parameters<typeof onBudgetAction>) => {
|
||||
onBudgetAction(...args);
|
||||
setBudgetMenuOpen(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<View
|
||||
style={{
|
||||
@@ -221,7 +226,7 @@ export const ExpenseCategoryMonth = memo(function ExpenseCategoryMonth({
|
||||
>
|
||||
<BudgetMenu
|
||||
onCopyLastMonthAverage={() => {
|
||||
onBudgetAction?.(month, 'copy-single-last', {
|
||||
onMenuAction(month, 'copy-single-last', {
|
||||
category: category.id,
|
||||
});
|
||||
}}
|
||||
@@ -234,12 +239,12 @@ export const ExpenseCategoryMonth = memo(function ExpenseCategoryMonth({
|
||||
return;
|
||||
}
|
||||
|
||||
onBudgetAction?.(month, `set-single-${numberOfMonths}-avg`, {
|
||||
onMenuAction(month, `set-single-${numberOfMonths}-avg`, {
|
||||
category: category.id,
|
||||
});
|
||||
}}
|
||||
onApplyBudgetTemplate={() => {
|
||||
onBudgetAction?.(month, 'apply-single-category-template', {
|
||||
onMenuAction(month, 'apply-single-category-template', {
|
||||
category: category.id,
|
||||
});
|
||||
}}
|
||||
|
||||
6
upcoming-release-notes/3092.md
Normal file
6
upcoming-release-notes/3092.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Bugfix
|
||||
authors: [sleepyfran]
|
||||
---
|
||||
|
||||
Correctly dismiss pop-over when using the copy last month's budget feature
|
||||
Reference in New Issue
Block a user