fix(files): clear search input on directory navigation

Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
This commit is contained in:
Maksim Sukharev 2025-10-10 11:38:34 +02:00
parent 2cb2ffe608
commit 196aa9b41b

View file

@ -24,8 +24,9 @@ const searchStore = useSearchStore()
* we need to clear the search box.
*/
onBeforeNavigation((to, from, next) => {
if (to.params.view !== VIEW_ID && from.params.view === VIEW_ID) {
// we are leaving the search view so unset the query
if (to.params.view !== VIEW_ID
&& (from.params.view === VIEW_ID || from.query.dir !== to.query.dir)) {
// we are leaving the search view or navigate to another directory -> unset the query
searchStore.query = ''
searchStore.scope = 'filter'
} else if (to.params.view === VIEW_ID && from.params.view === VIEW_ID) {