mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
close chat when ticket is closed
This commit is contained in:
parent
bf81c03708
commit
23535de418
@ -2003,6 +2003,10 @@ textfield */
|
||||
-fx-font-size: 0.846em;
|
||||
}
|
||||
|
||||
.dispute-chat-border {
|
||||
-fx-background-color: -bs-color-blue-5;
|
||||
}
|
||||
|
||||
/********************************************************************************************************************
|
||||
* *
|
||||
* DAO *
|
||||
|
@ -46,6 +46,8 @@ import javafx.scene.layout.StackPane;
|
||||
|
||||
import javafx.beans.value.ChangeListener;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
public class DisputeChatPopup {
|
||||
public interface ChatCallback {
|
||||
void onCloseDisputeFromChatWindow(Dispute dispute);
|
||||
@ -60,6 +62,7 @@ public class DisputeChatPopup {
|
||||
private double chatPopupStageYPosition = -1;
|
||||
private ChangeListener<Number> xPositionListener;
|
||||
private ChangeListener<Number> yPositionListener;
|
||||
@Getter private Dispute selectedDispute;
|
||||
|
||||
DisputeChatPopup(DisputeManager<? extends DisputeList<Dispute>> disputeManager,
|
||||
CoinFormatter formatter,
|
||||
@ -78,10 +81,12 @@ public class DisputeChatPopup {
|
||||
public void closeChat() {
|
||||
if (chatPopupStage != null)
|
||||
chatPopupStage.close();
|
||||
selectedDispute = null;
|
||||
}
|
||||
|
||||
public void openChat(Dispute selectedDispute, DisputeSession concreteDisputeSession, String counterpartyName) {
|
||||
closeChat();
|
||||
this.selectedDispute = selectedDispute;
|
||||
selectedDispute.getChatMessages().forEach(m -> m.setWasDisplayed(true));
|
||||
disputeManager.requestPersistence();
|
||||
|
||||
@ -96,7 +101,7 @@ public class DisputeChatPopup {
|
||||
AnchorPane.setRightAnchor(chatView, 10d);
|
||||
AnchorPane.setTopAnchor(chatView, -20d);
|
||||
AnchorPane.setBottomAnchor(chatView, 10d);
|
||||
pane.setStyle("-fx-background-color: -bs-color-blue-5");
|
||||
pane.getStyleClass().add("dispute-chat-border");
|
||||
Button closeDisputeButton = null;
|
||||
if (!selectedDispute.isClosed() && !disputeManager.isTrader(selectedDispute)) {
|
||||
closeDisputeButton = new AutoTooltipButton(Res.get("support.closeTicket"));
|
||||
|
@ -1366,6 +1366,8 @@ public abstract class DisputeView extends ActivatableView<VBox, Void> {
|
||||
setText(newValue ? Res.get("support.closed") : Res.get("support.open"));
|
||||
if (getTableRow() != null)
|
||||
getTableRow().setOpacity(newValue && item.getBadgeCountProperty().get() == 0 ? 0.4 : 1);
|
||||
if (item.isClosed() && item == chatPopup.getSelectedDispute())
|
||||
chatPopup.closeChat(); // close the chat popup when the associated ticket is closed
|
||||
};
|
||||
closedProperty = item.isClosedProperty();
|
||||
closedProperty.addListener(listener);
|
||||
|
Loading…
Reference in New Issue
Block a user