💄 front: trim filename before rename operation (fixes #660)
This commit is contained in:
@@ -62,7 +62,7 @@ const PropertiesModalContent = ({ id, onClose }: { id: string; onClose: () => vo
|
|||||||
const doSave = async () => {
|
const doSave = async () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
if (item) {
|
if (item) {
|
||||||
let finalName = name;
|
let finalName = (name || '').trim();
|
||||||
//TODO: Confirm rename if extension changed ?
|
//TODO: Confirm rename if extension changed ?
|
||||||
if (!item?.is_directory) {
|
if (!item?.is_directory) {
|
||||||
//TODO: Why do we trim extensions on folders ?
|
//TODO: Why do we trim extensions on folders ?
|
||||||
@@ -104,7 +104,7 @@ const PropertiesModalContent = ({ id, onClose }: { id: string; onClose: () => vo
|
|||||||
/>
|
/>
|
||||||
<br />
|
<br />
|
||||||
<Button
|
<Button
|
||||||
disabled={!name}
|
disabled={!((name || '').trim())}
|
||||||
className="float-right mt-4"
|
className="float-right mt-4"
|
||||||
theme="primary"
|
theme="primary"
|
||||||
loading={loading}
|
loading={loading}
|
||||||
|
|||||||
Reference in New Issue
Block a user