fix: ensure books display in biblical order (Old Testament → New Testament)

- Modified offline storage to sort books by orderNum after IndexedDB retrieval
- Fixed book ordering issue where books appeared out of sequence
- Books now consistently display: Genesis → Revelation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-30 12:00:08 +00:00
parent 2a031cdf76
commit fa72c992f4
2 changed files with 5 additions and 3 deletions

View File

@@ -210,11 +210,13 @@ class OfflineStorage {
async getBooksForVersion(versionId: string): Promise<BibleBook[]> {
await this.init()
return this.performTransaction('books', 'readonly', (store) => {
const books = await this.performTransaction('books', 'readonly', (store) => {
const booksStore = store as IDBObjectStore
const index = booksStore.index('versionId')
return index.getAll(versionId)
})
// Sort books by orderNum to maintain biblical order
return books.sort((a, b) => (a.orderNum || 0) - (b.orderNum || 0))
}
// Download progress management