From d7b00ce5f672b7ce0b26ce31abdfc74f8b00b939 Mon Sep 17 00:00:00 2001 From: Ariel Leyva Date: Fri, 6 Mar 2026 09:26:54 -0500 Subject: [PATCH] fix: avoid sending the same name in the file/folder rename modal (#5806) --- frontend/src/components/prompts/Rename.vue | 24 +++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/prompts/Rename.vue b/frontend/src/components/prompts/Rename.vue index f18ed7a0..4e1bb095 100644 --- a/frontend/src/components/prompts/Rename.vue +++ b/frontend/src/components/prompts/Rename.vue @@ -6,7 +6,7 @@

- {{ $t("prompts.renameMessage") }} {{ oldName() }}{{ oldName }}:

{{ $t("buttons.rename") }} @@ -56,7 +57,7 @@ export default { }; }, created() { - this.name = this.oldName(); + this.name = this.oldName; }, inject: ["$showError"], computed: { @@ -67,25 +68,28 @@ export default { "isListing", ]), ...mapWritableState(useFileStore, ["reload", "preselect"]), - }, - methods: { - ...mapActions(useLayoutStore, ["closeHovers"]), - cancel: function () { - this.closeHovers(); - }, - oldName: function () { + oldName() { if (!this.isListing) { return this.req.name; } if (this.selectedCount === 0 || this.selectedCount > 1) { // This shouldn't happen. - return; + return ""; } return this.req.items[this.selected[0]].name; }, + }, + methods: { + ...mapActions(useLayoutStore, ["closeHovers"]), + cancel: function () { + this.closeHovers(); + }, submit: async function () { + if (this.name === "" || this.name === this.oldName) { + return; + } let oldLink = ""; let newLink = "";