Add chapter number padding and debugging for chapter loading

This commit is contained in:
Ryderjj89
2025-09-13 15:43:13 -04:00
parent eb81bdc9e6
commit 1e819e33c7

View File

@@ -20,7 +20,13 @@ const BibleReader: React.FC<BibleReaderProps> = ({ book, chapter, onBack }) => {
const loadChapter = async () => {
try {
setLoading(true);
const chapterContent = await getChapter(book, chapter);
console.log(`Loading chapter: ${book}/${chapter}`);
// Pad chapter number with leading zero if needed
const paddedChapter = chapter.padStart(2, '0');
console.log(`Padded chapter: ${paddedChapter}`);
const chapterContent = await getChapter(book, paddedChapter);
setContent(chapterContent);
} catch (error) {
console.error('Failed to load chapter:', error);