Skip to content

Commit 4642f47

Browse files
committed
Fixed URL and title updates when changing passages
1 parent e9335f2 commit 4642f47

6 files changed

Lines changed: 14 additions & 0 deletions

File tree

modules/navigation.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export async function loadSelectedChapter(book = null, chapter = null) {
5454
const selBook = book || document.getElementById('bookSelect').value;
5555
const selChapter = chapter || document.getElementById('chapterSelect').value;
5656
const apiBook = getApiBookCode(selBook);
57+
document.title = `${selBook} ${selChapter} - Provinent Scripture Study`;
5758
try {
5859
showLoading(true);
5960
const apiTranslation = apiTranslationCode(state.settings.bibleTranslation);

modules/passage.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ export async function loadPassage(book = null, chapter = null, translation = nul
290290
}
291291
document.getElementById('passageReference').textContent = passage.displayRef;
292292
state.currentPassageReference = passage.displayRef;
293+
document.title = `${passage.displayRef} - Provinent Scripture Study`;
293294
await loadPassageFromAPI(passage);
294295
syncSelectorsToReadingPlan();
295296
}

modules/settings.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ export function resumeReadingPlan() {
9595
const curBook = state.settings.manualBook;
9696
const curChapter = state.settings.manualChapter;
9797
const idx = findReadingPlanIndex(curBook, curChapter);
98+
const translation = getCurrentTranslation();
99+
updateURL(translation, curBook, curChapter);
98100
if (idx !== -1) {
99101
state.settings.currentPassageIndex = idx;
100102
}

src/modules/navigation.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ export async function loadSelectedChapter(book = null, chapter = null) {
8888
const selBook = book || document.getElementById('bookSelect').value;
8989
const selChapter = chapter || document.getElementById('chapterSelect').value;
9090
const apiBook = getApiBookCode(selBook);
91+
92+
// Update browser title
93+
document.title = `${selBook} ${selChapter} - Provinent Scripture Study`;
9194

9295
try {
9396
showLoading(true);

src/modules/passage.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,8 @@ export async function loadPassage(book = null, chapter = null, translation = nul
432432

433433
document.getElementById('passageReference').textContent = passage.displayRef;
434434
state.currentPassageReference = passage.displayRef;
435+
436+
document.title = `${passage.displayRef} - Provinent Scripture Study`;
435437

436438
await loadPassageFromAPI(passage);
437439
syncSelectorsToReadingPlan();

src/modules/settings.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ export function resumeReadingPlan() {
135135
const curBook = state.settings.manualBook;
136136
const curChapter = state.settings.manualChapter;
137137
const idx = findReadingPlanIndex(curBook, curChapter);
138+
139+
// Update URL
140+
const translation = getCurrentTranslation();
141+
updateURL(translation, curBook, curChapter);
142+
138143
if (idx !== -1) {
139144
// Found a matching entry – make it the active reading‑plan index
140145
state.settings.currentPassageIndex = idx;

0 commit comments

Comments
 (0)