Apply suggestions from code review

This commit is contained in:
Daniel O'Connor 2025-02-01 19:16:29 +10:30 committed by GitHub
commit 8081293fe4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -55,7 +55,7 @@ export default defineComponent({
}, },
nextIndex() { nextIndex() {
// TODO: i18n stopwords in sync with the browser's implementation? Assumes . and ! are boundaries, may not be true for all languages. // TODO: i18n stopwords in sync with the browser's implementation? Assumes . and ! are boundaries, may not be true for all languages.
const match = this.step.text.slice(this.currentIndex).search(/[\.\!]/) const match = this.step.text.slice(this.currentIndex).search(/[.!]/)
if (match === -1) { if (match === -1) {
return this.currentIndex; return this.currentIndex;
} }
@ -120,7 +120,7 @@ export default defineComponent({
// console.log(event) // console.log(event)
// }; // };
utterance.onerror = (event) => { utterance.onerror = (event) => {
if (event.error == "interrupted") { if (event.error === "interrupted") {
this.playing = false; this.playing = false;
this.played = false; this.played = false;
this.paused = false; this.paused = false;