Skip to content
Snippets Groups Projects
Unverified Commit b54e4a6c authored by Anton Georgiev's avatar Anton Georgiev Committed by GitHub
Browse files

Merge pull request #12831 from hiroshisuga/patch-41

this.recognition can be null
parents 8eac0b9b 5477ac7b
No related branches found
No related tags found
No related merge requests found
...@@ -87,13 +87,15 @@ class Pad extends PureComponent { ...@@ -87,13 +87,15 @@ class Pad extends PureComponent {
this.toggleListen = this.toggleListen.bind(this); this.toggleListen = this.toggleListen.bind(this);
this.handleListen = this.handleListen.bind(this); this.handleListen = this.handleListen.bind(this);
this.recognition.addEventListener('end', () => { if (this.recognition) {
const { listening } = this.state; this.recognition.addEventListener('end', () => {
if (listening) { const { listening } = this.state;
notify(intl.formatMessage(intlMessages.speechRecognitionStop), 'info', 'warning'); if (listening) {
this.stopListen(); notify(intl.formatMessage(intlMessages.speechRecognitionStop), 'info', 'warning');
} this.stopListen();
}); }
});
}
} }
componentDidUpdate() { componentDidUpdate() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment