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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user