refactor: remove previous scroll rentention logic
This commit is contained in:
parent
25e47c3ce8
commit
bfbd78bee0
@ -57,7 +57,6 @@ export default {
|
|||||||
submit: async function () {
|
submit: async function () {
|
||||||
buttons.loading("delete");
|
buttons.loading("delete");
|
||||||
|
|
||||||
window.sessionStorage.setItem("modified", "true");
|
|
||||||
try {
|
try {
|
||||||
if (!this.isListing) {
|
if (!this.isListing) {
|
||||||
await api.remove(this.$route.path);
|
await api.remove(this.$route.path);
|
||||||
|
|||||||
@ -97,7 +97,6 @@ export default {
|
|||||||
newLink =
|
newLink =
|
||||||
url.removeLastDir(oldLink) + "/" + encodeURIComponent(this.name);
|
url.removeLastDir(oldLink) + "/" + encodeURIComponent(this.name);
|
||||||
|
|
||||||
window.sessionStorage.setItem("modified", "true");
|
|
||||||
try {
|
try {
|
||||||
await api.move([{ from: oldLink, to: newLink }]);
|
await api.move([{ from: oldLink, to: newLink }]);
|
||||||
if (!this.isListing) {
|
if (!this.isListing) {
|
||||||
|
|||||||
@ -102,15 +102,7 @@ onUnmounted(() => {
|
|||||||
fetchDataController.abort();
|
fetchDataController.abort();
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(route, (to, from) => {
|
watch(route, () => {
|
||||||
if (from.path.endsWith("/")) {
|
|
||||||
window.sessionStorage.setItem(
|
|
||||||
"listFrozen",
|
|
||||||
(!to.path.endsWith("/")).toString()
|
|
||||||
);
|
|
||||||
} else if (to.path.endsWith("/")) {
|
|
||||||
fileStore.updateRequest(null);
|
|
||||||
}
|
|
||||||
fetchData();
|
fetchData();
|
||||||
});
|
});
|
||||||
watch(reload, (newValue) => {
|
watch(reload, (newValue) => {
|
||||||
@ -130,12 +122,7 @@ const fetchData = async () => {
|
|||||||
layoutStore.closeHovers();
|
layoutStore.closeHovers();
|
||||||
|
|
||||||
// Set loading to true and reset the error.
|
// Set loading to true and reset the error.
|
||||||
if (
|
|
||||||
window.sessionStorage.getItem("listFrozen") !== "true" &&
|
|
||||||
window.sessionStorage.getItem("modified") !== "true"
|
|
||||||
) {
|
|
||||||
layoutStore.loading = true;
|
layoutStore.loading = true;
|
||||||
}
|
|
||||||
error.value = null;
|
error.value = null;
|
||||||
|
|
||||||
let url = route.path;
|
let url = route.path;
|
||||||
|
|||||||
@ -420,10 +420,6 @@ const isMobile = computed(() => {
|
|||||||
|
|
||||||
watch(req, () => {
|
watch(req, () => {
|
||||||
// Reset the show value
|
// Reset the show value
|
||||||
if (
|
|
||||||
window.sessionStorage.getItem("listFrozen") !== "true" &&
|
|
||||||
window.sessionStorage.getItem("modified") !== "true"
|
|
||||||
) {
|
|
||||||
showLimit.value = 50;
|
showLimit.value = 50;
|
||||||
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
@ -434,11 +430,6 @@ watch(req, () => {
|
|||||||
// Fill and fit the window with listing items
|
// Fill and fit the window with listing items
|
||||||
fillWindow(true);
|
fillWindow(true);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
if (req.value?.isDir) {
|
|
||||||
window.sessionStorage.setItem("listFrozen", "false");
|
|
||||||
window.sessionStorage.setItem("modified", "false");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user