Skip to content

Commit

Permalink
Only execute disconnect logic if already listening
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesBrill committed Aug 21, 2020
1 parent af3d083 commit 74d44eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/RecognitionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default class RecognitionManager {
}

disconnect(disconnectType) {
if (this.browserSupportsSpeechRecognition) {
if (this.browserSupportsSpeechRecognition && this.listening) {
switch (disconnectType) {
case 'ABORT':
this.pauseAfterDisconnect = true
Expand Down

0 comments on commit 74d44eb

Please sign in to comment.