From 6487a5946ba8e658088dbb2c51eb8ac5d495d523 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Tue, 20 Oct 2020 20:48:42 +0000 Subject: [PATCH] Format code with prettier This commit fixes the style issues introduced in 5293ae3 according to the output from prettier. Details: https://deepsource.io/gh/MillenniumEarl/F95API/transform/266ac9b1-e124-46f9-907f-e66bdcdc002c/ --- app/index.js | 12 ++++++------ app/scripts/game-scraper.js | 3 ++- app/scripts/game-searcher.js | 2 +- app/scripts/urls-helper.js | 8 ++++---- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app/index.js b/app/index.js index 52cfbe9..f302bb5 100644 --- a/app/index.js +++ b/app/index.js @@ -485,7 +485,7 @@ async function loginF95(browser, username, password) { page.waitForSelector(selectors.PASSWORD_INPUT), page.waitForSelector(selectors.LOGIN_BUTTON), ]); - + await page.type(selectors.USERNAME_INPUT, username); // Insert username await page.type(selectors.PASSWORD_INPUT, password); // Insert password await Promise.all([ @@ -552,10 +552,10 @@ async function getUserWatchedGameThreads(browser) { // Show the popup await Promise.all([ - page.click(selectors.WATCHED_THREAD_FILTER_POPUP_BUTTON), - page.waitForSelector(selectors.UNREAD_THREAD_CHECKBOX), - page.waitForSelector(selectors.ONLY_GAMES_THREAD_OPTION), - page.waitForSelector(selectors.FILTER_THREADS_BUTTON), + page.click(selectors.WATCHED_THREAD_FILTER_POPUP_BUTTON), + page.waitForSelector(selectors.UNREAD_THREAD_CHECKBOX), + page.waitForSelector(selectors.ONLY_GAMES_THREAD_OPTION), + page.waitForSelector(selectors.FILTER_THREADS_BUTTON), ]); // Set the filters @@ -564,7 +564,7 @@ async function getUserWatchedGameThreads(browser) { document.querySelector(selector).removeAttribute("checked"), selectors.UNREAD_THREAD_CHECKBOX ); // Also read the threads already read - + // Filter the threads await Promise.all([ page.click(selectors.ONLY_GAMES_THREAD_OPTION), diff --git a/app/scripts/game-scraper.js b/app/scripts/game-scraper.js index b7db258..3079d82 100644 --- a/app/scripts/game-scraper.js +++ b/app/scripts/game-scraper.js @@ -24,7 +24,8 @@ module.exports.getGameInfo = async function (browser, url) { if (shared.debug) console.log("Obtaining game info"); // Verify the correctness of the URL - if (!urlsHelper.isF95URL(url)) throw new Error(url + " is not a valid F95Zone URL"); + if (!urlsHelper.isF95URL(url)) + throw new Error(url + " is not a valid F95Zone URL"); const exists = await urlsHelper.urlExists(url); if (!exists) return null; diff --git a/app/scripts/game-searcher.js b/app/scripts/game-searcher.js index 89fe6cb..c5d8366 100644 --- a/app/scripts/game-searcher.js +++ b/app/scripts/game-searcher.js @@ -30,7 +30,7 @@ module.exports.getSearchGameResults = async function (browser, gamename) { await Promise.all([ page.waitForSelector(selectors.SEARCH_FORM_TEXTBOX), page.waitForSelector(selectors.TITLE_ONLY_CHECKBOX), - page.waitForSelector(selectors.SEARCH_BUTTON) + page.waitForSelector(selectors.SEARCH_BUTTON), ]); await page.type(selectors.SEARCH_FORM_TEXTBOX, gamename); // Type the game we desire diff --git a/app/scripts/urls-helper.js b/app/scripts/urls-helper.js index 48ee295..69b9612 100644 --- a/app/scripts/urls-helper.js +++ b/app/scripts/urls-helper.js @@ -66,7 +66,7 @@ module.exports.urlExists = async function (url, checkRedirect) { * @param {String} url URL to check for redirect * @returns {Promise} Redirect URL or the passed URL */ -module.exports.getUrlRedirect = async function(url) { - const response = await ky.head(url); - return response.url; -} +module.exports.getUrlRedirect = async function (url) { + const response = await ky.head(url); + return response.url; +};