Skip to content

Commit 401cc39

Browse files
GiteaBotwxiaoguang
andauthored
Fix incorrect subpath in links (#29535) (#29541)
Backport #29535 by wxiaoguang * `$referenceUrl`: it is constructed by "Issue.Link", which already has the "AppSubURL" * `window.location.href`: AppSubURL could be empty string, so it needs the trailing slash Co-authored-by: wxiaoguang <[email protected]>
1 parent 3a8877c commit 401cc39

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

templates/repo/diff/comments.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<div class="comment-header-right actions gt-df gt-ac">
3434
{{if .Invalidated}}
3535
{{$referenceUrl := printf "%s#%s" $.root.Issue.Link .HashTag}}
36-
<a href="{{AppSubUrl}}{{$referenceUrl}}" class="ui label basic small" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.outdated_description"}}">
36+
<a href="{{$referenceUrl}}" class="ui label basic small" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.outdated_description"}}">
3737
{{ctx.Locale.Tr "repo.issues.review.outdated"}}
3838
</a>
3939
{{end}}

templates/repo/diff/conversation.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
We only handle the case $resolved=true and $invalid=true in this template because if the comment is not resolved it has the outdated label in the comments area (not the header above).
1515
The case $resolved=false and $invalid=true is handled in repo/diff/comments.tmpl
1616
-->
17-
<a href="{{AppSubUrl}}{{$referenceUrl}}" class="ui label basic small gt-ml-3" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.outdated_description"}}">
17+
<a href="{{$referenceUrl}}" class="ui label basic small gt-ml-3" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.outdated_description"}}">
1818
{{ctx.Locale.Tr "repo.issues.review.outdated"}}
1919
</a>
2020
{{end}}

web_src/js/features/notification.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export function initNotificationCount() {
112112
type: 'close',
113113
});
114114
worker.port.close();
115-
window.location.href = appSubUrl;
115+
window.location.href = `${appSubUrl}/`;
116116
} else if (event.data.type === 'close') {
117117
worker.port.postMessage({
118118
type: 'close',

web_src/js/features/stopwatch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function initStopwatch() {
7474
type: 'close',
7575
});
7676
worker.port.close();
77-
window.location.href = appSubUrl;
77+
window.location.href = `${appSubUrl}/`;
7878
} else if (event.data.type === 'close') {
7979
worker.port.postMessage({
8080
type: 'close',

0 commit comments

Comments
 (0)