Web Push Zustand und Deep Links stabilisieren
All checks were successful
CI / Build and Deploy (push) Successful in 2m59s
All checks were successful
CI / Build and Deploy (push) Successful in 2m59s
This commit is contained in:
@@ -50,6 +50,7 @@ type BudgetColumnProps = {
|
||||
busy: boolean;
|
||||
approvalThreshold: number;
|
||||
requiredApprovalTypes: ("CHAIR_A" | "CHAIR_B" | "FINANCE")[];
|
||||
focusBudgetId?: string | null;
|
||||
onApprove: (expenseId: string, approvalType: "CHAIR_A" | "CHAIR_B" | "FINANCE") => Promise<void>;
|
||||
onMarkPaid: (expenseId: string) => Promise<void>;
|
||||
onDocument: (expenseId: string, proofUrl?: string) => Promise<void>;
|
||||
@@ -143,6 +144,7 @@ export function BudgetColumn({
|
||||
busy,
|
||||
approvalThreshold,
|
||||
requiredApprovalTypes,
|
||||
focusBudgetId,
|
||||
onApprove,
|
||||
onMarkPaid,
|
||||
onDocument,
|
||||
@@ -193,6 +195,12 @@ export function BudgetColumn({
|
||||
}
|
||||
}, [group.budgets, selectedBudgetId]);
|
||||
|
||||
useEffect(() => {
|
||||
if (focusBudgetId && group.budgets.some((budget) => budget.id === focusBudgetId)) {
|
||||
setSelectedBudgetId(focusBudgetId);
|
||||
}
|
||||
}, [focusBudgetId, group.budgets]);
|
||||
|
||||
const approvedSpend = useMemo(
|
||||
() => group.budgets.reduce((sum, budget) => sum + getApprovedSpend(budget.expenses), 0),
|
||||
[group.budgets]
|
||||
|
||||
Reference in New Issue
Block a user