Skip to content

Commit

Permalink
debug tests
Browse files Browse the repository at this point in the history
  • Loading branch information
codyzu committed Jul 26, 2023
1 parent 732d32b commit 0f26032
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pages/Upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,16 @@ export default function Upload() {
return;
}

console.log('waiting for pages');
const nextPages = await Promise.all(uploadPromises);
console.log('pages done')
const nextNotes = nextPages.map((_, pageIndex) => ({
pageIndices: [pageIndex] as [number, ...number[]],
markdown: '',
}));

setPages(nextPages);
setNotes(nextNotes);

setUploadState('setting pages');
}

Expand All @@ -248,12 +249,14 @@ export default function Upload() {
}

setSavingState('saving');
console.log('updating doc with pages')
await updateDoc(presentationRef, {
pages,
rendered: new Date(),
title,
notes,
} satisfies PresentationUpdate);
console.log('doc update done')
setUploadState('done');
setSavingState((currentState) =>
currentState === 'saving' ? 'saved' : currentState,
Expand Down

0 comments on commit 0f26032

Please sign in to comment.