Skip to content

Commit c3247a5

Browse files
committed
fix redirect
1 parent cb0c106 commit c3247a5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

routers/web/user/notification.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ package user
66
import (
77
"fmt"
88
"net/http"
9-
"net/url"
109
"strings"
1110

1211
activities_model "code.gitea.io/gitea/models/activities"
@@ -61,11 +60,11 @@ func prepareUserNotificationsData(ctx *context.Context) {
6160
return
6261
}
6362

64-
// redirect to the last page if request page is more than total pages
6563
pager := context.NewPagination(int(total), perPage, page, 5)
6664
if pager.Paginater.Current() < page {
67-
ctx.Redirect(fmt.Sprintf("%s/notifications?type=%s&page=%d", setting.AppSubURL, url.QueryEscape(pageType), pager.Paginater.Current()))
68-
return
65+
// use the last page if the requested page is more than total pages
66+
page = pager.Paginater.Current()
67+
pager = context.NewPagination(int(total), perPage, page, 5)
6968
}
7069

7170
statuses := []activities_model.NotificationStatus{queryStatus, activities_model.NotificationStatusPinned}

0 commit comments

Comments
 (0)