Skip to content

Commit

Permalink
Update search-by-voice.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
ctf0 committed Mar 13, 2021
1 parent e0922c8 commit c53c5fe
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/resources/assets/js/components/search-by-voice.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ export default {
data() {
return {
run : false,
isSupported: true,
isSupported: false,
transcript : null
}
},
created() {
if (!annyang) {
this.isSupported = false
console.error('Speech Recognition is not supported')
if (annyang) {
this.isSupported = true
} else {
// console.error('Speech Recognition is not supported')
}
},
mounted() {
Expand Down Expand Up @@ -66,7 +67,7 @@ export default {
},
watch: {
searchFor(val) {
if (!val) {
if (!val && this.isSupported) {
this.transcript = null
this.stop()
}
Expand Down

0 comments on commit c53c5fe

Please sign in to comment.