From b302d3c0b399b49748275b1ffba21539ecb87020 Mon Sep 17 00:00:00 2001 From: niubility000 <76441520+niubility000@users.noreply.github.com> Date: Thu, 15 Feb 2024 21:10:19 +0800 Subject: [PATCH] Update Files.vue --- frontend/src/views/Files.vue | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/frontend/src/views/Files.vue b/frontend/src/views/Files.vue index ff7b84a6..2d67fdd7 100644 --- a/frontend/src/views/Files.vue +++ b/frontend/src/views/Files.vue @@ -3,10 +3,10 @@ - + -
+

@@ -52,13 +52,10 @@ export default { computed: { ...mapState(["req", "reload", "loading"]), currentView() { - if (this.req.type == undefined) { + if (this.req.type == undefined || this.req.isDir) { return null; } - - if (this.req.isDir) { - return "listing"; - } else if ( + else if ( this.req.type === "text" || this.req.type === "textImmutable" ) { @@ -72,7 +69,26 @@ export default { this.fetchData(); }, watch: { - $route: "fetchData", + $route: function (to, from) { + if (from.path.endsWith("/")) { + if (to.path.endsWith("/")) { + window.sessionStorage.setItem('listFrozen', "false"); + this.fetchData(); + return; + } else { + window.sessionStorage.setItem('listFrozen', "true"); + this.fetchData(); + return; + } + } else if (to.path.endsWith("/")) { + this.$store.commit("updateRequest", {}); + this.fetchData(); + return; + } else { + this.fetchData(); + return; + } + }, reload: function (value) { if (value === true) { this.fetchData(); @@ -101,7 +117,9 @@ export default { this.$store.commit("closeHovers"); // Set loading to true and reset the error. - this.setLoading(true); + if (window.sessionStorage.getItem('listFrozen') !=="true"){ + this.setLoading(true); + } this.error = null; let url = this.$route.path;