MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / paste

Function paste

frontend/src/hooks/useFileManager.ts:385–409  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

383 };
384
385 const paste = async () => {
386 if (!clipboard?.value?.type || !clipboard.value.value)
387 return reportErrorMsg(t("TXT_CODE_b152cd75"));
388 const execute = clipboard.value.type == "copy" ? copyFileApi().execute : moveFileApi().execute;
389 try {
390 await execute({
391 params: {
392 uuid: instanceId || "",
393 daemonId: daemonId || ""
394 },
395 data: {
396 targets: clipboard.value.value.map((e) => [
397 e,
398 currentPath.value + e.split("/")[e.split("/").length - 1]
399 ])
400 }
401 });
402 await getFileList();
403 message.success(t("TXT_CODE_93d4b66a"));
404 clearSelected();
405 clipboard.value.value = [];
406 } catch (error: any) {
407 reportErrorMsg(error.message);
408 }
409 };
410
411 const resetName = async (file: string) => {
412 const newname = await openDialog(t("TXT_CODE_c83551f5"), t("TXT_CODE_a5830778"), file);

Callers

nothing calls this directly

Calls 4

reportErrorMsgFunction · 0.90
executeFunction · 0.85
getFileListFunction · 0.85
clearSelectedFunction · 0.85

Tested by

no test coverage detected