From 3b2fd229a5dec7c2c7aaf5881230566ef7ba46db Mon Sep 17 00:00:00 2001 From: effe Date: Tue, 10 Sep 2024 12:26:20 -0400 Subject: [PATCH] feat: button disable logic --- .../java/com/application/munera/views/people/PeopleView.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/application/munera/views/people/PeopleView.java b/src/main/java/com/application/munera/views/people/PeopleView.java index 21a46e5..b264bbc 100644 --- a/src/main/java/com/application/munera/views/people/PeopleView.java +++ b/src/main/java/com/application/munera/views/people/PeopleView.java @@ -97,6 +97,7 @@ public class PeopleView extends Div implements BeforeEnterObserver { } else if (persona instanceof Expense) { Button setExpensePaidButton = new Button("Set as paid", event -> this.expenseFacade.setExpensePaid((Expense) persona, grid)); setExpensePaidButton.addThemeVariants(ButtonVariant.LUMO_SMALL); + if (Boolean.TRUE.equals(((Expense) persona).getIsPaid())) setExpensePaidButton.setEnabled(false); return setExpensePaidButton; } else return new Span(); }));