fix: remain in the same position of list after rename or delete Rename.vue

This commit is contained in:
niubility000 2024-02-24 17:26:02 +08:00 committed by GitHub
parent 88b463c665
commit 0174e9a847
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -88,6 +88,7 @@ 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) {
@ -100,6 +101,9 @@ export default {
this.$showError(e); this.$showError(e);
} }
Vue.nextTick(() => {
window.sessionStorage.setItem('modified', "false");
});
this.$store.commit("closeHovers"); this.$store.commit("closeHovers");
}, },
}, },