From 1915fd6e8b7b0c83a9a1b9254fd945f1cc0c7c19 Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Sun, 23 Feb 2020 18:18:17 +0100
Subject: viewer: go to parent command fix when in search mode

Code review fix
---
 viewer/src/components/LdCommand.vue | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'viewer/src/components/LdCommand.vue')

diff --git a/viewer/src/components/LdCommand.vue b/viewer/src/components/LdCommand.vue
index 468c241..c0b86be 100644
--- a/viewer/src/components/LdCommand.vue
+++ b/viewer/src/components/LdCommand.vue
@@ -46,11 +46,12 @@ export default class LdCommand extends Vue {
   }
 
   isRoot(): boolean {
-    return this.currentItemPath.length <= 1;
+    return this.currentItemPath.length <= 1 && !this.$uiStore.searchMode;
   }
 
   parent(): RawLocation {
-    if (!this.isRoot()) return this.currentItemPath[this.currentItemPath.length - 2];
+    if (this.$uiStore.searchMode) return this.$route.path;
+    if (this.currentItemPath.length > 1) return this.currentItemPath[this.currentItemPath.length - 2];
     return "";
   }
 }
-- 
cgit v1.2.3

