Stop epub audio on back fix
This commit is contained in:
parent
01ba8d57ba
commit
b7dc67f97f
1 changed files with 3 additions and 2 deletions
|
|
@ -28,7 +28,7 @@ interface EPUBContextType {
|
||||||
const EPUBContext = createContext<EPUBContextType | undefined>(undefined);
|
const EPUBContext = createContext<EPUBContextType | undefined>(undefined);
|
||||||
|
|
||||||
export function EPUBProvider({ children }: { children: ReactNode }) {
|
export function EPUBProvider({ children }: { children: ReactNode }) {
|
||||||
const { setText: setTTSText, currDocPage, currDocPages, setCurrDocPages } = useTTS();
|
const { setText: setTTSText, currDocPage, currDocPages, setCurrDocPages, stop } = useTTS();
|
||||||
|
|
||||||
// Current document state
|
// Current document state
|
||||||
const [currDocData, setCurrDocData] = useState<ArrayBuffer>();
|
const [currDocData, setCurrDocData] = useState<ArrayBuffer>();
|
||||||
|
|
@ -51,7 +51,8 @@ export function EPUBProvider({ children }: { children: ReactNode }) {
|
||||||
setCurrDocName(undefined);
|
setCurrDocName(undefined);
|
||||||
setCurrDocText(undefined);
|
setCurrDocText(undefined);
|
||||||
setCurrDocPages(undefined);
|
setCurrDocPages(undefined);
|
||||||
}, [setCurrDocPages]);
|
stop();
|
||||||
|
}, [setCurrDocPages, stop]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the current document based on its ID
|
* Sets the current document based on its ID
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue