diff --git a/frontend/src/components/TradeBox/EncryptedChat/EncryptedTurtleChat/index.tsx b/frontend/src/components/TradeBox/EncryptedChat/EncryptedTurtleChat/index.tsx index 44cd0097..6ad9509e 100644 --- a/frontend/src/components/TradeBox/EncryptedChat/EncryptedTurtleChat/index.tsx +++ b/frontend/src/components/TradeBox/EncryptedChat/EncryptedTurtleChat/index.tsx @@ -169,9 +169,13 @@ const EncryptedTurtleChat: React.FC = ({ apiClient .post(baseUrl, `/api/chat`, { PGP_message: value, + offset: lastIndex }) .then((response) => { - if (response) onMessage(response as ServerMessage); + if (response) { + setPeerConnected(response.peer_connected); + setServerMessages(response.messages); + } }) .finally(() => { setWaitingEcho(false); @@ -188,9 +192,13 @@ const EncryptedTurtleChat: React.FC = ({ .post(baseUrl, `/api/chat/`, { PGP_message: encryptedMessage.toString().split('\n').join('\\'), order_id: orderId, + offset: lastIndex }) .then((response) => { - if (response) onMessage(response as ServerMessage); + if (response) { + setPeerConnected(response.peer_connected); + setServerMessages(response.messages); + } }) .finally(() => { setWaitingEcho(false); diff --git a/frontend/src/components/TradeBox/index.js b/frontend/src/components/TradeBox/index.js index fa632450..a55de870 100644 --- a/frontend/src/components/TradeBox/index.js +++ b/frontend/src/components/TradeBox/index.js @@ -74,7 +74,7 @@ class TradeBox extends Component { badInvoice: false, badAddress: false, badStatement: false, - turtleMode: false, + turtleMode: window.ReactNativeWebView !== undefined }; } @@ -1434,38 +1434,40 @@ class TradeBox extends Component { {/* Make confirmation sound for Chat Open. */} {this.Sound('locked-invoice')} -
- -
- this.setState({ turtleMode: !this.state.turtleMode })} - /> - -
-
-
+
+ this.setState({ turtleMode: !this.state.turtleMode })} + /> + +
+ + + ) : <>} {' '}