Apply cached TTS location before remote progress
This commit is contained in:
parent
eebb54b018
commit
2a2ba35454
1 changed files with 12 additions and 13 deletions
|
|
@ -3228,19 +3228,6 @@ export function TTSProvider({ children }: { children: ReactNode }): ReactElement
|
|||
};
|
||||
|
||||
const load = async () => {
|
||||
try {
|
||||
const remote = await getDocumentProgress(docId);
|
||||
if (!cancelled && remote?.location) {
|
||||
await setLastDocumentLocation(docId, remote.location).catch((error) => {
|
||||
console.warn('Error caching remote location locally:', error);
|
||||
});
|
||||
applyLocation(remote.location);
|
||||
return;
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn('Error loading remote progress:', error);
|
||||
}
|
||||
|
||||
try {
|
||||
const local = await getLastDocumentLocation(docId);
|
||||
if (!cancelled && local) {
|
||||
|
|
@ -3249,6 +3236,18 @@ export function TTSProvider({ children }: { children: ReactNode }): ReactElement
|
|||
} catch (error) {
|
||||
console.warn('Error loading local last location:', error);
|
||||
}
|
||||
|
||||
try {
|
||||
const remote = await getDocumentProgress(docId);
|
||||
if (!cancelled && remote?.location) {
|
||||
await setLastDocumentLocation(docId, remote.location).catch((error) => {
|
||||
console.warn('Error caching remote location locally:', error);
|
||||
});
|
||||
applyLocation(remote.location);
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn('Error loading remote progress:', error);
|
||||
}
|
||||
};
|
||||
|
||||
load();
|
||||
|
|
|
|||
Loading…
Reference in a new issue