MCPcopy Create free account
hub / github.com/chieapp/chie / #onLogin

Method #onLogin

src/view/new-api-window.ts:120–138  ·  view source on GitHub ↗
(apiRecord)

Source from the content-addressed store, hash-verified

118 }
119
120 async #onLogin(apiRecord) {
121 this.loginButton.setEnabled(false);
122 this.submitButton.setEnabled(false);
123 try {
124 const info = await apiRecord.login();
125 if (info.cookie)
126 this.apiParams.getRow('cookie').setValue(info.cookie);
127 if (info.params) {
128 for (const name in info.params)
129 this.apiParams.getRow(name)?.setValue(info.params[name]);
130 }
131 } catch (error) {
132 if (error.name != 'CancelledError')
133 alert(error.message);
134 } finally {
135 this.loginButton.setEnabled(true);
136 this.submitButton.setEnabled(true);
137 }
138 }
139
140 #onSubmit() {
141 const name = this.apiSelector.getValue('name') as string;

Callers

nothing calls this directly

Calls 3

alertFunction · 0.85
getRowMethod · 0.80
setValueMethod · 0.45

Tested by

no test coverage detected