Skip to content

Commit 420c301

Browse files
committed
preview: update name resolution logic
1 parent e1856ca commit 420c301

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

sites/preview/src/lib/Tree.svelte

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@
4646
},
4747
},
4848
dialog: {
49-
failedToCopyItems: {
50-
en: "Failed to copy items",
51-
ar: "فشل نسخ العناصر",
52-
},
5349
failedToMoveItems: {
5450
en: "Failed to move items",
5551
ar: "فشل نقل العناصر",
@@ -192,21 +188,13 @@
192188
operation,
193189
name,
194190
}: OnResolveNameConflictArgs<FileNode, FolderNode>) {
195-
return new Promise<NameConflictResolution>((resolve) => {
196-
let title;
197-
switch (operation) {
198-
case "copy": {
199-
title = translations.dialog.failedToCopyItems[lang];
200-
break;
201-
}
202-
case "move": {
203-
title = translations.dialog.failedToMoveItems[lang];
204-
break;
205-
}
206-
}
191+
if (operation === "copy") {
192+
return "default";
193+
}
207194
195+
return new Promise<NameConflictResolution>((resolve) => {
208196
showDialog({
209-
title,
197+
title: translations.dialog.failedToMoveItems[lang],
210198
description: translations.dialog.nameConflictDescription[lang](name),
211199
confirmLabel: translations.dialog.skip[lang],
212200
cancelLabel: translations.dialog.cancel[lang],

0 commit comments

Comments
 (0)