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