Refactor task handling and improve status checking in issue management web

This commit is contained in:
Robin Olsen
2026-04-03 13:41:10 +02:00
parent 88f4998601
commit bf8ea6103e
8 changed files with 37 additions and 19 deletions

View File

@@ -56,7 +56,11 @@ templ IssueDetailPage(issue *models.Issue, comments []*models.Comment) {
headers: { 'HX-Request': 'true' }
})
this.editing = null
// Check if server wants to redirect back to list
// Check status after 1 second
setTimeout(() => {
document.body.dispatchEvent(new CustomEvent('check-status'))
}, 1000)
// Handle redirect if needed
const redirectUrl = response.headers.get('HX-Redirect')
if (redirectUrl) {
window.location.href = redirectUrl