Skip to content

Commit

Permalink
fix(voiceSearch): fix wrong status when stopped
Browse files Browse the repository at this point in the history
  • Loading branch information
Eunjae Lee committed Jun 5, 2019
1 parent 5cefe7c commit 84cc9f9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/voiceSearchHelper/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ export default function createVoiceSearchHelper({

const stop = (): void => {
dispose();
resetState();
// Because `dispose` removes event listeners, `end` listener is not called.
// So we're setting the `status` as `finished` here.
// If we don't do it, it will be still `waiting` or `recognizing`.
resetState('finished');
};

const start = (): void => {
Expand Down

0 comments on commit 84cc9f9

Please sign in to comment.