|
|
@ -345,13 +345,7 @@ export default class ChatInput { |
|
|
|
attachClickEvent(this.btnSend, this.onBtnSendClick, {listenerSetter: this.listenerSetter, touchMouseDown: true}); |
|
|
|
attachClickEvent(this.btnSend, this.onBtnSendClick, {listenerSetter: this.listenerSetter, touchMouseDown: true}); |
|
|
|
|
|
|
|
|
|
|
|
if(this.recorder) { |
|
|
|
if(this.recorder) { |
|
|
|
const onCancelRecordClick = (e: Event) => { |
|
|
|
attachClickEvent(this.btnCancelRecord, this.onCancelRecordClick, {listenerSetter: this.listenerSetter}); |
|
|
|
cancelEvent(e); |
|
|
|
|
|
|
|
this.recordCanceled = true; |
|
|
|
|
|
|
|
this.recorder.stop(); |
|
|
|
|
|
|
|
opusDecodeController.setKeepAlive(false); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
attachClickEvent(this.btnCancelRecord, onCancelRecordClick, {listenerSetter: this.listenerSetter}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.recorder.onstop = () => { |
|
|
|
this.recorder.onstop = () => { |
|
|
|
this.recording = false; |
|
|
|
this.recording = false; |
|
|
@ -422,6 +416,16 @@ export default class ChatInput { |
|
|
|
this.rowsWrapper.classList.add('is-centered'); |
|
|
|
this.rowsWrapper.classList.add('is-centered'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private onCancelRecordClick = (e?: Event) => { |
|
|
|
|
|
|
|
if(e) { |
|
|
|
|
|
|
|
cancelEvent(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.recordCanceled = true; |
|
|
|
|
|
|
|
this.recorder.stop(); |
|
|
|
|
|
|
|
opusDecodeController.setKeepAlive(false); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
private onEmoticonsOpen = () => { |
|
|
|
private onEmoticonsOpen = () => { |
|
|
|
const toggleClass = isTouchSupported ? 'flip-icon' : 'active'; |
|
|
|
const toggleClass = isTouchSupported ? 'flip-icon' : 'active'; |
|
|
|
this.btnToggleEmoticons.classList.toggle(toggleClass, true); |
|
|
|
this.btnToggleEmoticons.classList.toggle(toggleClass, true); |
|
|
@ -900,7 +904,7 @@ export default class ChatInput { |
|
|
|
if(!this.recorder || this.recording || !this.isInputEmpty() || this.forwardingMids.length || this.editMsgId) { |
|
|
|
if(!this.recorder || this.recording || !this.isInputEmpty() || this.forwardingMids.length || this.editMsgId) { |
|
|
|
if(this.recording) { |
|
|
|
if(this.recording) { |
|
|
|
if((Date.now() - this.recordStartTime) < RECORD_MIN_TIME) { |
|
|
|
if((Date.now() - this.recordStartTime) < RECORD_MIN_TIME) { |
|
|
|
this.btnCancelRecord.click(); |
|
|
|
this.onCancelRecordClick(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.recorder.stop(); |
|
|
|
this.recorder.stop(); |
|
|
|
} |
|
|
|
} |
|
|
|