@setoelkahfi / svara / commits / 71e71cd

fix: no prompt if moving file/folder into itself

Signed-off-by: mellobacon <mellodev@outlook.com>

mellobacon committed Nov 5, 2023 at 16:31 UTC 71e71cd170c609fe6f0d244145b6057064cf51dc
1 file changed +3
src/lib/File.ts
+3
@@ -142,6 +142,9 @@ export function cancelDirectoryLoad(msg: string) {
142 }
143
144 export async function moveFile(source: string, dest: string, file: string) {
145 + if (file === dest) {
146 + return;
147 + }
148 const filename = file.split(path.sep).pop();
149 if (!await dialog.confirm(`Are you sure you want to move "${filename}" from "./${source.split(path.sep).pop()}" into "./${dest.split(path.sep).pop()}?"`, {title: "Nucleus: Move File"})) {
150 return;