MCPcopy Index your code
hub / github.com/CopyTranslator/CopyTranslator / promptForName

Method promptForName

src/main/controller.ts:79–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

77 }
78
79 promptForName() {
80 const l = store.getters.locale;
81 electronPrompt(
82 {
83 title: l["snapshotPrompt"],
84 label: l["snapshotValidate"],
85 value: "",
86 inputAttrs: {
87 type: "text",
88 },
89 type: "input",
90 icon: icon,
91 },
92 this.win.mainWindow
93 )
94 .then((r: any) => {
95 if (r === null) {
96 console.log("user cancelled");
97 } else {
98 if (isValidSnapshotName(r as string)) {
99 this.handle("newConfigSnapshot", r);
100 } else {
101 this.promptForName();
102 }
103 }
104 })
105 .catch(console.error);
106 }
107
108 handle(identifier: Identifier, param: any = null): boolean {
109 switch (identifier) {

Callers 1

handleMethod · 0.95

Calls 3

handleMethod · 0.95
electronPromptFunction · 0.90
isValidSnapshotNameFunction · 0.90

Tested by

no test coverage detected