Skip to content

Commit 45aa4ea

Browse files
authored
Fix pagination on /notifications/watching (#23564)
The `q` parameter was not rendered in pagination links because `context.Pagination:AddParam` checks for existance of the parameter in `ctx.Data` where it was absent. Added the parameter there to fix it.
1 parent 6250fe1 commit 45aa4ea

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

routers/web/user/notification.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,9 @@ func NotificationWatching(ctx *context.Context) {
344344
page = 1
345345
}
346346

347+
keyword := ctx.FormTrim("q")
348+
ctx.Data["Keyword"] = keyword
349+
347350
var orderBy db.SearchOrderBy
348351
ctx.Data["SortType"] = ctx.FormString("sort")
349352
switch ctx.FormString("sort") {
@@ -378,7 +381,7 @@ func NotificationWatching(ctx *context.Context) {
378381
Page: page,
379382
},
380383
Actor: ctx.Doer,
381-
Keyword: ctx.FormTrim("q"),
384+
Keyword: keyword,
382385
OrderBy: orderBy,
383386
Private: ctx.IsSigned,
384387
WatchedByID: ctx.Doer.ID,

0 commit comments

Comments
 (0)