diff --git a/api/management/commands/follow_invoices.py b/api/management/commands/follow_invoices.py
index c88ee749..eaa36601 100644
--- a/api/management/commands/follow_invoices.py
+++ b/api/management/commands/follow_invoices.py
@@ -5,7 +5,6 @@ from api.models import LNPayment, Order
from api.logics import Logics
from django.utils import timezone
-from datetime import timedelta
from decouple import config
from base64 import b64decode
import time
diff --git a/api/models.py b/api/models.py
index 01ef8117..942d811a 100644
--- a/api/models.py
+++ b/api/models.py
@@ -19,7 +19,7 @@ BOND_SIZE = float(config('BOND_SIZE'))
class Currency(models.Model):
- currency_dict = json.load(open('./frontend/static/assets/currencies.json'))
+ currency_dict = json.load(open('frontend/static/assets/currencies.json'))
currency_choices = [(int(val), label) for val, label in list(currency_dict.items())]
currency = models.PositiveSmallIntegerField(choices=currency_choices, null=False, unique=True)
@@ -175,7 +175,7 @@ class Order(models.Model):
8 : 60*int(config('INVOICE_AND_ESCROW_DURATION')), # 'Waiting only for buyer invoice'
9 : 60*60*int(config('FIAT_EXCHANGE_DURATION')), # 'Sending fiat - In chatroom'
10 : 60*60*int(config('FIAT_EXCHANGE_DURATION')), # 'Fiat sent - In chatroom'
- 11 : 1*24*60*60, # 'In dispute'
+ 11 : 1*24*60*60, # 'In dispute'
12 : 0, # 'Collaboratively cancelled'
13 : 24*60*60, # 'Sending satoshis to buyer'
14 : 24*60*60, # 'Sucessful trade'
diff --git a/frontend/src/components/TradeBox.js b/frontend/src/components/TradeBox.js
index b132ebf4..1d7b90ac 100644
--- a/frontend/src/components/TradeBox.js
+++ b/frontend/src/components/TradeBox.js
@@ -44,6 +44,17 @@ export default class TradeBox extends Component {
}
}
+ Sound = ({soundFileName}) => (
+ // Four filenames: "locked-invoice", "taker-found", "open-chat", "sucessful"
+
+ )
+
+ togglePlay = () => {
+ this.setState({ playSound: !this.state.playSound }, () => {
+ this.state.playSound ? this.audio.play() : this.audio.pause();
+ });
+ }
+
handleClickOpenConfirmDispute = () => {
this.setState({openConfirmDispute: true});
};
@@ -182,6 +193,8 @@ export default class TradeBox extends Component {
showEscrowQRInvoice=()=>{
return (
+ {/* Make confirmation sound for HTLC received. */}
+
Deposit {pn(this.props.data.escrow_satoshis)} Sats as trade collateral
@@ -208,11 +221,10 @@ export default class TradeBox extends Component {
}
showTakerFound=()=>{
-
- // TODO Make some sound here! The maker might have been waiting for long
-
return (
+ {/* Make bell sound when taker is found */}
+
A taker has been found!
@@ -232,6 +244,8 @@ export default class TradeBox extends Component {
showMakerWait=()=>{
return (
+ {/* Make confirmation sound for HTLC received. */}
+
Your order is public. Wait for a taker.
@@ -338,6 +352,8 @@ export default class TradeBox extends Component {
// TODO Option to upload files and images
+ {/* In case the taker was very fast to scan the bond, make the taker found alarm sound again */}
+
Submit a LN invoice for {pn(this.props.data.invoice_amount)} Sats
@@ -459,6 +475,8 @@ export default class TradeBox extends Component {
showWaitingForBuyerInvoice(){
return(
+ {/* Make confirmation sound for HTLC received. */}
+
The trade collateral is locked! 🎉
@@ -571,6 +589,8 @@ handleRatingChange=(e)=>{
return(
+ {/* Make confirmation sound for Chat Open. */}
+
Chatting with {this.props.data.is_maker ? this.props.data.taker_nick : this.props.data.maker_nick}
@@ -603,6 +623,8 @@ handleRatingChange=(e)=>{
showRateSelect(){
return(
+ {/* Make confirmation sound for Chat Open. */}
+
🎉Trade finished!🥳
diff --git a/frontend/static/assets/sounds/chat-open.mp3 b/frontend/static/assets/sounds/chat-open.mp3
new file mode 100644
index 00000000..ed3e3083
Binary files /dev/null and b/frontend/static/assets/sounds/chat-open.mp3 differ
diff --git a/frontend/static/assets/sounds/locked-invoice.mp3 b/frontend/static/assets/sounds/locked-invoice.mp3
new file mode 100644
index 00000000..ed3e3083
Binary files /dev/null and b/frontend/static/assets/sounds/locked-invoice.mp3 differ
diff --git a/frontend/static/assets/sounds/sucessful.mp3 b/frontend/static/assets/sounds/sucessful.mp3
new file mode 100644
index 00000000..b43450ef
Binary files /dev/null and b/frontend/static/assets/sounds/sucessful.mp3 differ
diff --git a/frontend/static/assets/sounds/taker-found.mp3 b/frontend/static/assets/sounds/taker-found.mp3
new file mode 100644
index 00000000..2650a1cd
Binary files /dev/null and b/frontend/static/assets/sounds/taker-found.mp3 differ