Fix end of document reached
This commit is contained in:
parent
429ec3f264
commit
b6880b9910
1 changed files with 4 additions and 0 deletions
|
|
@ -134,6 +134,10 @@ export function TTSProvider({ children }: { children: React.ReactNode }) {
|
|||
setCurrDocPage(currDocPage - 1);
|
||||
|
||||
return 0;
|
||||
} else if (nextIndex >= sentences.length && currDocPage >= currDocPages!) {
|
||||
console.log('Reached end of document');
|
||||
setIsPlaying(false);
|
||||
return prev;
|
||||
}
|
||||
return prev;
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue