Skip to content

Commit

Permalink
fix(#9732): infinite loop on privacy policy page
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpascal committed Jan 8, 2025
1 parent cfa682f commit c3240f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
11 changes: 4 additions & 7 deletions api/src/public/privacy-policy/script.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
document.addEventListener('DOMContentLoaded', function() {
const backButton = document.getElementById('back-button');
if (backButton) {
backButton.addEventListener('click', function() {
history.go(-1);
}, false);
}
document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('.back-button').forEach(button => {
button.addEventListener('click', () => window.history.back());
});
});
4 changes: 2 additions & 2 deletions api/src/templates/privacy-policy/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<body>
<div>
<% if(showBackButton) { %>
<a id="back-button" href="#">{{ translations.back }}</a>
<a class="back-button" href="#">{{ translations.back }}</a>
<% } else { %>
<a href="/">{{ translations.login }}</a>
<% } %>
Expand All @@ -40,7 +40,7 @@ <h1>{{ translations.title }}</h1>
</div>
<div>
<% if(showBackButton) { %>
<a id="back-button" href="#">{{ translations.back }}</a>
<a class="back-button" href="#">{{ translations.back }}</a>
<% } else { %>
<a href="/">{{ translations.login }}</a>
<% } %>
Expand Down

0 comments on commit c3240f1

Please sign in to comment.