Skip to content

Commit c0c2cb9

Browse files
authored
Fix incorrect subpath in links (#29535)
* `$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
1 parent 9043584 commit c0c2cb9

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
@@ -75,7 +75,7 @@ export function initStopwatch() {
7575
type: 'close',
7676
});
7777
worker.port.close();
78-
window.location.href = appSubUrl;
78+
window.location.href = `${appSubUrl}/`;
7979
} else if (event.data.type === 'close') {
8080
worker.port.postMessage({
8181
type: 'close',

0 commit comments

Comments
 (0)