diff --git a/frontend/src/components/EncryptedChat.js b/frontend/src/components/EncryptedChat.js
index a203fe35..04788ceb 100644
--- a/frontend/src/components/EncryptedChat.js
+++ b/frontend/src/components/EncryptedChat.js
@@ -144,11 +144,13 @@ class Chat extends Component {
}
componentDidUpdate() {
-
- // Only fire the scroll when the reason for Update is a new message
+
+ // Only fire the scroll and audio when the reason for Update is a new message
if (this.state.scrollNow){
+ const audio = new Audio(`/static/assets/sounds/chat-open.mp3`)
+ audio.play();
this.scrollToBottom();
- this.setState({scrollNow:false})
+ this.setState({scrollNow:false});
}
}
diff --git a/frontend/src/components/TradeBox.js b/frontend/src/components/TradeBox.js
index c9490fa4..fb268ceb 100644
--- a/frontend/src/components/TradeBox.js
+++ b/frontend/src/components/TradeBox.js
@@ -52,12 +52,6 @@ class TradeBox extends Component {
)
- togglePlay = () => {
- this.setState({ playSound: !this.state.playSound }, () => {
- this.state.playSound ? this.audio.play() : this.audio.pause();
- });
- }
-
stepXofY = () => {
// set y value
var x = null
@@ -286,8 +280,8 @@ class TradeBox extends Component {
const { t } = this.props;
return (
- {/* Make confirmation sound for HTLC received. */}
- {this.Sound("locked-invoice")}
+ {/* Make sound for Taker found or HTLC received. */}
+ {this.props.data.is_maker ? this.Sound("taker-found") : this.Sound("locked-invoice")}
@@ -328,8 +322,8 @@ class TradeBox extends Component {
const { t } = this.props;
return (
- {/* Make bell sound when taker is found */}
- {this.Sound("taker-found")}
+ {/* Make bell sound when taker is found. SUPRESSED: It's annoying, not the right moment! Play only after taker locks bon */}
+ {/* {this.Sound("taker-found")} */}
{t("A taker has been found!")} {" " + this.stepXofY()}
@@ -638,8 +632,8 @@ class TradeBox extends Component {
- {/* Make confirmation sound for HTLC received. */}
- {this.Sound("locked-invoice")}
+ {/* Make sound for Taker found or HTLC received. */}
+ {this.props.data.is_maker ? this.Sound("taker-found") : this.Sound("locked-invoice")}
{t("Submit payout info for {{amountSats}} Sats",{amountSats: pn(this.props.data.invoice_amount)})}
{" " + this.stepXofY()}
diff --git a/frontend/static/assets/sounds/chat-open.mp3 b/frontend/static/assets/sounds/chat-open.mp3
index ed3e3083..3031169a 100644
Binary files a/frontend/static/assets/sounds/chat-open.mp3 and b/frontend/static/assets/sounds/chat-open.mp3 differ