From 9ea1443074faab2fe7639b61019f2af739d205d0 Mon Sep 17 00:00:00 2001 From: MillenniumEarl Date: Wed, 10 Mar 2021 11:35:30 +0100 Subject: [PATCH] Prettify script --- src/scripts/classes/mapping/thread.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/scripts/classes/mapping/thread.ts b/src/scripts/classes/mapping/thread.ts index f391896..ca583c1 100644 --- a/src/scripts/classes/mapping/thread.ts +++ b/src/scripts/classes/mapping/thread.ts @@ -17,7 +17,13 @@ import { urls } from "../../constants/url"; import { POST, THREAD } from "../../constants/css-selector"; import { fetchHTML, fetchPOSTResponse } from "../../network-helper"; import Shared from "../../shared"; -import { InvalidID, INVALID_THREAD_ID, ParameterError, UserNotLogged, USER_NOT_LOGGED } from "../errors"; +import { + InvalidID, + INVALID_THREAD_ID, + ParameterError, + UserNotLogged, + USER_NOT_LOGGED +} from "../errors"; import { getJSONLD, TJsonLD } from "../../scrape-data/json-ld"; import shared from "../../shared"; @@ -238,7 +244,9 @@ export default class Thread implements ILazy { // Fetch the HTML source const response = await fetchHTML(this.url); - const result = response.applyOnSuccess(this.elaborateResponse); + const result = response.applyOnSuccess( + async (html) => await this.elaborateResponse(html) + ); if (result.isFailure()) throw result.value; }