MCPcopy Create free account
hub / github.com/MathMan05/Fermi / doFetch

Method doFetch

src/webpage/settings.ts:2353–2394  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2351 if (this.traditionalSubmit) {
2352 this.owner.changed();
2353 }
2354 }
2355 preprocessor: (obj: Object) => void = () => {};
2356 addPreprocessor(func: (obj: Object) => void) {
2357 this.preprocessor = func;
2358 }
2359 onFormError = (_: FormError) => {};
2360 submitLock = new PromiseLock();
2361 async submit() {
2362 if (this.submitLock.locked) return;
2363 const lock = await this.submitLock.acquireLock();
2364 try {
2365 await this.submitInt();
2366 } finally {
2367 lock();
2368 }
2369 }
2370 private async submitInt() {
2371 if (this.options.subOptions) {
2372 this.options.subOptions.submit();
2373 return;
2374 }
2375
2376 console.log("start");
2377 const build = {};
2378 for (const key of Object.keys(this.values)) {
2379 const thing = this.values[key];
2380 if (thing instanceof Function) {
2381 try {
2382 (build as any)[key] = thing();
2383 } catch (e: any) {
2384 if (e instanceof FormError) {
2385 this.handleError(e);
2386 }
2387 return;
2388 }
2389 } else {
2390 (build as any)[key] = thing;
2391 }
2392 }
2393 console.log("middle");
2394 const promises: Promise<void>[] = [];
2395 for (const thing of this.names.keys()) {
2396 if (thing === "") continue;
2397 const input = this.names.get(thing) as OptionsElement<any>;

Callers

nothing calls this directly

Calls 5

errorsMethod · 0.95
showPrimErrorMethod · 0.95
handleCaptchaFunction · 0.85
handle2faFunction · 0.85
parseMethod · 0.45

Tested by

no test coverage detected