MCPcopy Create free account
hub / github.com/UNLINEARITY/Obsidian-CodeSpace / submit

Method submit

src/main.ts:84–100  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

82 }
83
84 private submit(value: string) {
85 const fileName = value.trim();
86 if (fileName) {
87 let fullPath = "";
88 // 如果用户输入了包含斜杠的路径,则忽略默认位置,直接使用用户输入的路径
89 if (fileName.includes("/")) {
90 fullPath = normalizePath(fileName);
91 } else {
92 // 否则使用选中的位置 + 文件名
93 fullPath = normalizePath(this.currentPath + "/" + fileName);
94 }
95 this.result = fullPath;
96 this.close();
97 } else {
98 new Notice("Please enter a file name");
99 }
100 }
101
102 onClose() {
103 super.onClose();

Callers 1

constructorMethod · 0.95

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected