fix(tasks): Let getCommentUrl handle frontendUrl including sub-path

This commit is contained in:
MidoriKurage 2026-04-03 10:04:15 +08:00 committed by kolaente
parent 44122bfe6b
commit 2d2dbf67a0
1 changed files with 3 additions and 1 deletions

View File

@ -506,7 +506,9 @@ async function deleteComment(commentToDelete: ITaskComment) {
function getCommentUrl(commentId: string) {
const baseUrl = frontendUrl.value.endsWith('/') ? frontendUrl.value.slice(0, -1) : frontendUrl.value
return `${baseUrl}${location.pathname}${location.search}#comment-${commentId}`
const url = new URL(location.pathname + location.search, baseUrl)
url.hash = `comment-${commentId}`
return url.toString()
}
</script>