Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
- Fixed an off by 1 bug in merging blank verses (looks like it's not importing the last blank verse for USFM)
- Fixed a re-entry bug in the onOK handler (just returns to the home page if the book name has already been cleared out)
  • Loading branch information
eb1 committed Nov 15, 2023
1 parent 87fe84d commit 9de2114
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion www/js/views/DocumentViews.js
Original file line number Diff line number Diff line change
Expand Up @@ -3692,7 +3692,7 @@ define(function (require) {
// special case -- blank verses
console.log("Empty verse(s) at end: " + vCount);
var tmpMrks, Idx1, Idx2;
for (var vIdx = 0; vIdx < vCount - 1; vIdx++) {
for (var vIdx = 0; vIdx < vCount; vIdx++) {
// pull out the marker for this blank verse
Idx1 = markers.indexOf("\\v ", 0); // _this_ verse
Idx2 = markers.indexOf("\\v ", Idx1 + 1); // next verse
Expand Down Expand Up @@ -6402,6 +6402,11 @@ define(function (require) {
// - If the user has changed the book name, update the name value in the book and each chapter
// - Close out the import and move to the home page
onOK: function () {
if (bookName.length === 0) {
// prevent re-entry -- just go to the home page
window.Application.home();
return;
}
if (isKB === false) {
// update the book name if necessary
if ($("#BookName").length > 0 && $("#BookName").val() !== bookName) {
Expand Down

0 comments on commit 9de2114

Please sign in to comment.