Skip to content

Commit

Permalink
add history.back() if user returns at the start of the pwa and there …
Browse files Browse the repository at this point in the history
…is still history left
  • Loading branch information
sanderhollaar committed Nov 2, 2022
1 parent b47dcbf commit dae2a45
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions webapp/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ function setWindow(window, back) {
if (back) {
backButton
.click(() => {clearStatus(); setWindow(back); return false;})
.removeAttr('href')
.removeClass('button-hidden');
} else if (history.length == 1) {
} else if (history.length > 1) {
backButton
.click(() => {clearStatus(); history.back(); return false;})
.removeClass('button-hidden');
} else {
backButton.addClass('button-hidden');
}

Expand Down

0 comments on commit dae2a45

Please sign in to comment.