Skip to content

Commit

Permalink
test: just test :neckbeard:
Browse files Browse the repository at this point in the history
  • Loading branch information
bieshan committed Jan 3, 2021
1 parent 4db62a6 commit 82a1ff1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,8 @@ const Home = () => {
recognizerRef.current.lang = "ja-JP";
recognizerRef.current.interimResults = true;
recognizerRef.current.continuous = true;
recognizerRef.current.onstart = () => {
setDetecting(true);
};
recognizerRef.current.onend = () => {
if (detecting) {
// androidは自動停止するため、フラグを使って自動リスタート
if (!detecting) {
recognizerRef.current.start();
};
};
Expand Down Expand Up @@ -158,6 +154,7 @@ const Home = () => {
color="primary"
size="large"
onClick={() => {
setDetecting(true);
recognizerRef.current.start();
}}
>
Expand Down

0 comments on commit 82a1ff1

Please sign in to comment.