You've already forked filebrowser
mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-11-26 14:25:26 +08:00
feat: select item on file list after navigating back (#5329)
This commit is contained in:
@@ -48,16 +48,15 @@ export default {
|
||||
"selectedCount",
|
||||
"req",
|
||||
"selected",
|
||||
"currentPrompt",
|
||||
]),
|
||||
...mapWritableState(useFileStore, ["reload"]),
|
||||
...mapState(useLayoutStore, ["currentPrompt"]),
|
||||
...mapWritableState(useFileStore, ["reload", "preselect"]),
|
||||
},
|
||||
methods: {
|
||||
...mapActions(useLayoutStore, ["closeHovers"]),
|
||||
submit: async function () {
|
||||
buttons.loading("delete");
|
||||
|
||||
window.sessionStorage.setItem("modified", "true");
|
||||
try {
|
||||
if (!this.isListing) {
|
||||
await api.remove(this.$route.path);
|
||||
@@ -81,6 +80,12 @@ export default {
|
||||
|
||||
await Promise.all(promises);
|
||||
buttons.success("delete");
|
||||
|
||||
const nearbyItem =
|
||||
this.req.items[Math.max(0, Math.min(this.selected) - 1)];
|
||||
|
||||
this.preselect = nearbyItem?.path;
|
||||
|
||||
this.reload = true;
|
||||
} catch (e) {
|
||||
buttons.done("delete");
|
||||
|
||||
Reference in New Issue
Block a user