Skip to content

Commit

Permalink
Reset page number when changing search in mobile version (fix #2715)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Jun 15, 2022
1 parent 5855f18 commit 85a0b4f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/gui-qml/src/components/SearchScreen.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Page {

property int page: 1
property string site
property bool queryChanged: false

TagSearchLoader {
id: pageLoader
Expand All @@ -25,11 +26,18 @@ Page {
perPage: 20
postFilter: textFieldPostFiltering.text
profile: backend.profile

onQueryChanged: searchTab.queryChanged = true
}

function load(tag) {
if (tag) {
textFieldSearch.text = tag
queryChanged = true
}
if (queryChanged) {
page = 1
queryChanged = false
}
pageLoader.load()
}
Expand Down

0 comments on commit 85a0b4f

Please sign in to comment.