From b27d5b2dccee2d837d878c0d71cf053ad4ab9b70 Mon Sep 17 00:00:00 2001
From: niubility000 <76441520+niubility000@users.noreply.github.com>
Date: Sat, 16 Mar 2024 02:55:06 +0800
Subject: [PATCH] fix: remain in the same position of list when back
---
frontend/src/views/Files.vue | 50 +++++++++++++++++++-----------------
1 file changed, 27 insertions(+), 23 deletions(-)
diff --git a/frontend/src/views/Files.vue b/frontend/src/views/Files.vue
index a6cd13bf..2c09af24 100644
--- a/frontend/src/views/Files.vue
+++ b/frontend/src/views/Files.vue
@@ -4,18 +4,20 @@
-
-
-
-
-
- {{ $t("files.loading") }}
-
-
+
+
+
+
+
+
+ {{ $t("files.loading") }}
+
+
+
@@ -74,26 +76,18 @@ export default {
this.parentDir = "true";
} else {
this.parentDir = "false";
- window.sessionStorage.removeItem(to.path);
+ window.sessionStorage.removeItem(to.path);
}
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;
}
+ this.fetchData();
},
reload: function (value) {
if (value === true) {
@@ -125,7 +119,7 @@ export default {
// Set loading to true and reset the error.
if (window.sessionStorage.getItem("listFrozen") !=="true"
&& window.sessionStorage.getItem("modified") !=="true"
- && this.parentDir !== "true"){
+ && this.parentDir !== "true"){
this.setLoading(true);
}
this.error = null;
@@ -159,3 +153,13 @@ export default {
},
};
+