From 352221eced9267be64d2f02d09827adf368a9f7e Mon Sep 17 00:00:00 2001 From: Alexandru Date: Wed, 11 Dec 2024 01:07:10 +0200 Subject: [PATCH] Remove find return flights (for all) option --- README.md | 2 +- manifest.json | 2 +- popup.html | 10 +--------- popup.js | 21 ++++----------------- 4 files changed, 7 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 165363b..9502722 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ a) (recommended) Get from Chrome Store https://chromewebstore.google.com/detail/ b) To install this Chrome extension: -1. Download [https://github.com/vloss3/wizz-aycf-route-finder/archive/refs/tags/1.3.1.zip](https://github.com/vloss3/wizz-aycf-route-finder/archive/refs/tags/1.3.1.zip) +1. Download [https://github.com/vloss3/wizz-aycf-route-finder/archive/refs/tags/1.3.2.zip](https://github.com/vloss3/wizz-aycf-route-finder/archive/refs/tags/1.3.2.zip) 2. Unzip the file. diff --git a/manifest.json b/manifest.json index 34f6628..6911cd3 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 3, "name": "AYCF Route Finder", "description": "Simple(<1mb) Chrome extension to find all available routes on Wizz AYCF (All-You-Can-Fly). Not affiliated with Wizz Air.", - "version": "1.3.1", + "version": "1.3.2", "permissions": [ "activeTab" ], diff --git a/popup.html b/popup.html index ee8f1a9..09958f1 100644 --- a/popup.html +++ b/popup.html @@ -43,14 +43,6 @@

Wizz AYCF Route Finder

-
-
- -
-
@@ -65,7 +57,7 @@

Wizz AYCF Route Finder

Disclaimer: This extension is not affiliated with Wizz Air or its partners in any way. It is a personal project to help Multipass users like me find available routes.

Please use responsibly and at your own risk. Doing too many searches in a short period of time will result in temporary rate limiting.

-

Version 1.3.1 - Changelog

+

Version 1.3.2 - Changelog

diff --git a/popup.js b/popup.js index ba53f8d..2bb6798 100644 --- a/popup.js +++ b/popup.js @@ -144,10 +144,8 @@ async function checkAllRoutes() { console.log("checkAllRoutes started"); const originInput = document.getElementById("airport-input"); const dateSelect = document.getElementById("date-select"); - const checkReturnsCheckbox = document.getElementById("check-returns"); const origin = originInput.value.toUpperCase(); const selectedDate = dateSelect.value; - const checkReturns = checkReturnsCheckbox.checked; if (!origin) { alert("Please enter a departure airport code."); @@ -230,7 +228,7 @@ async function checkAllRoutes() { flightsByDate[selectedDate] = []; } flightsByDate[selectedDate].push(flightInfo); - displayResults(flightsByDate, checkReturns, true); + displayResults(flightsByDate, true); }); } } catch (error) { @@ -261,18 +259,7 @@ async function checkAllRoutes() { routeListElement.innerHTML = `

No flights available for ${selectedDate}.

`; } else { setCachedResults(cacheKey, flightsByDate[selectedDate]); - await displayResults(flightsByDate, checkReturns); - - if (checkReturns) { - const returnPromises = flightsByDate[selectedDate].map( - async (flight) => { - const returnFlights = await findReturnFlight(flight); - const returnCacheKey = `${cacheKey}-return-${flight.route}`; - setCachedResults(returnCacheKey, returnFlights); - } - ); - await Promise.all(returnPromises); - } + await displayResults(flightsByDate); } } } catch (error) { @@ -288,7 +275,7 @@ function formatDate(date) { return `${year}-${month}-${day}`; } -function displayResults(flightsByDate, checkReturns, append = false) { +function displayResults(flightsByDate, append = false) { const resultsDiv = document.querySelector(".route-list"); if (!resultsDiv) { console.error("Error: .route-list element not found in the DOM"); @@ -403,7 +390,7 @@ function displayResults(flightsByDate, checkReturns, append = false) { const returnCacheKey = `${origin}-${date}-return-${flight.route}`; const cachedReturnData = localStorage.getItem(returnCacheKey); - if (!checkReturns && !cachedReturnData) { + if (!cachedReturnData) { const findReturnButton = document.createElement("button"); findReturnButton.textContent = "Find Return"; findReturnButton.style.width = "100px";