From b252a96d47529749bb1d5e7a8d06fb7ce284b4ee Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Sun, 23 Feb 2020 18:19:33 +0100
Subject: viewer: searching when viewing a picture will return to the parent
 directory

Code review fix
---
 viewer/src/views/PanelLeft.vue | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'viewer/src/views/PanelLeft.vue')

diff --git a/viewer/src/views/PanelLeft.vue b/viewer/src/views/PanelLeft.vue
index fd117a6..eb921b7 100644
--- a/viewer/src/views/PanelLeft.vue
+++ b/viewer/src/views/PanelLeft.vue
@@ -34,6 +34,7 @@
 <script lang="ts">
 import { Component, Vue, Prop } from "vue-property-decorator";
 import { Dictionary } from "vue-router/types/router";
+import Navigation from "../services/navigation";
 
 @Component
 export default class PanelLeft extends Vue {
@@ -43,7 +44,8 @@ export default class PanelLeft extends Vue {
   }
 
   search() {
-    this.$router.push({ query: this.serializeSearch() }).catch(err => {
+    const lastDirectory = Navigation.getLastDirectory(this.$galleryStore.currentItemPath);
+    this.$router.push({ path: lastDirectory.path, query: this.serializeSearch() }).catch(err => {
       if (err.name !== "NavigationDuplicated") throw err;
     });
   }
-- 
cgit v1.2.3

