Remove listener before setting a new one

This fixes update issues reported in #3731.
This commit is contained in:
Christoph Atteneder 2019-12-16 15:42:16 +01:00
parent 3e378b99dd
commit c8848e1ef5
No known key found for this signature in database
GPG key ID: CD5DC1C529CDFD3B

View file

@ -892,6 +892,10 @@ public abstract class DisputeView extends ActivatableView<VBox, Void> {
public void updateItem(final Dispute item, boolean empty) {
super.updateItem(item, empty);
if (item != null && !empty) {
if (closedProperty != null) {
closedProperty.removeListener(listener);
}
listener = (observable, oldValue, newValue) -> {
setText(newValue ? Res.get("support.closed") : Res.get("support.open"));
if (getTableRow() != null)