Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
eb1 committed Feb 20, 2024
1 parent 5a489d8 commit b561330
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions www/js/views/DocumentViews.js
Original file line number Diff line number Diff line change
Expand Up @@ -6294,15 +6294,22 @@ define(function (require) {
chap.save({name: newChapterName});
if (firstChapWithVerses === null && chap.get('versecount') !== 0) {
firstChapWithVerses = chap;
// it's possible we also need to change the lastAdaptedName for this chapter book
if (this.model.get("lastAdaptedName").indexOf(bookName) > -1) {
// we have chapters -- use the first one that has some verses
this.model.set('lastAdaptedName', chap.get('name'));
}
}
}
// last document and chapter (if the first import)
// note that these might have already been set in the readXXXDoc() methods above
if (this.model.get('lastDocument') === bookName) {
this.model.set('lastDocument', newName);
}
if (this.model.get('lastAdaptedName') === "" && firstChapWithVerses !== null) {
this.model.set('lastAdaptedName', firstChapWithVerses.get('name'));
// test for lastAdaptedName === bookName (first import for a plain text file)
if (this.model.get("lastAdaptedName") === bookName) {
// no chapter -- set to newName
this.model.set('lastAdaptedName', newName);
}
if (this.model.get('lastAdaptedBookID') === 0) {
this.model.set('lastAdaptedBookID', book.get("bookid"));
Expand Down

0 comments on commit b561330

Please sign in to comment.