fix forwarding previews, remove audio button when forwarding

This commit is contained in:
or-else
2022-03-16 20:01:00 -07:00
parent 7044ce08c1
commit 3d2af23f14
8 changed files with 28 additions and 31 deletions
+3 -3
View File
@@ -45,7 +45,7 @@ class SendMessage extends React.PureComponent {
quote: null,
message: '',
audioRec: false,
audioEnabled: !!navigator.mediaDevices.getUserMedia && this.props.onAttachAudio,
audioAvailable: !!navigator.mediaDevices.getUserMedia,
// Make initial keypress time as if it happened 5001 milliseconds in the past.
keypressTimestamp: new Date().getTime() - KEYPRESS_DELAY - 1
};
@@ -201,7 +201,7 @@ class SendMessage extends React.PureComponent {
</div>
{this.state.quote}
</div>);
const audioEnabled = this.state.audioAvailable && this.props.onAttachAudio;
return (
<div id="send-message-wrapper">
{this.state.quote && !this.props.noInput ? quote : null}
@@ -230,7 +230,7 @@ class SendMessage extends React.PureComponent {
onKeyPress={this.handleKeyPress}
ref={(ref) => {this.messageEditArea = ref;}}
autoFocus />)}
{this.state.message || !this.state.audioEnabled ?
{this.state.message || !audioEnabled ?
<a href="#" onClick={this.handleSend} title="Send">
<i className="material-icons">send</i>
</a> :