diff --git a/src/contexts/TTSContext.tsx b/src/contexts/TTSContext.tsx index 7517271..f1e0e9e 100644 --- a/src/contexts/TTSContext.tsx +++ b/src/contexts/TTSContext.tsx @@ -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();