Skip to content

Commit

Permalink
Expiration support for highlight and delete
Browse files Browse the repository at this point in the history
  • Loading branch information
svera committed May 31, 2024
1 parent e0ee822 commit 4a0a30e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/webserver/embedded/js/delete.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ deleteForm.addEventListener('submit', event => {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({
'id': deleteForm.elements['id'].value,
'id': deleteForm.elements['id'].value,
})
})
.then((response) => {
if (response.ok) {
if (response.ok || response.status == "403") {
location.reload();
} else {
let message = document.getElementById("error-message-container");
Expand Down
3 changes: 3 additions & 0 deletions internal/webserver/embedded/js/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ Array.from(links).forEach((link) => {
}
return;
}
if (response.status == "403") {
location.reload()
}
})
.catch(function (error) {
// Catch errors
Expand Down

0 comments on commit 4a0a30e

Please sign in to comment.