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 = "";