fix chat message listeners by returning source observable list (#830)

This commit is contained in:
woodser 2024-03-18 10:47:43 -04:00 committed by GitHub
parent 317aa2e72f
commit 3c7841ae28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 13 deletions

View file

@ -394,6 +394,7 @@ public abstract class Trade implements Tradable, Model {
@Setter
@Nullable
private String counterCurrencyTxId;
@Getter
private final ObservableList<ChatMessage> chatMessages = FXCollections.observableArrayList();
// Transient
@ -1666,12 +1667,6 @@ public abstract class Trade implements Tradable, Model {
throw new IllegalArgumentException("Trade is not buyer, seller, or arbitrator");
}
public ObservableList<ChatMessage> getChatMessages() {
synchronized (chatMessages) {
return FXCollections.observableArrayList(chatMessages);
}
}
public MessageState getPaymentSentMessageState() {
if (isPaymentReceived()) return MessageState.ACKNOWLEDGED;
if (processModel.getPaymentSentMessageStateProperty().get() == MessageState.ACKNOWLEDGED) return MessageState.ACKNOWLEDGED;