From da4106eb1ae4c8e964519f7cd73b4d7b7596d106 Mon Sep 17 00:00:00 2001 From: Inokentii Mazhara Date: Tue, 26 Dec 2023 13:08:05 +0200 Subject: [PATCH] TW-1222 Remove unnecessary memoization --- src/replaceAds.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/replaceAds.ts b/src/replaceAds.ts index 88caa8e68e..e608df6ead 100644 --- a/src/replaceAds.ts +++ b/src/replaceAds.ts @@ -1,4 +1,3 @@ -import memoize from 'p-memoize'; import browser from 'webextension-polyfill'; import { ContentScriptType, WEBSITES_ANALYTICS_ENABLED } from 'lib/constants'; @@ -17,7 +16,7 @@ let oldHref = ''; let processing = false; -const getSliseAdsData = memoize(async (location: Location) => { +const getSliseAdsData = async (location: Location) => { const { hostname, href } = location; const res: TempleResponse | nullish = await getIntercom().request({ @@ -29,7 +28,7 @@ const getSliseAdsData = memoize(async (location: Location) => { if (res?.type === TempleMessageType.ExternalAdsDataResponse) return res.data; throw new Error('Unmatched Intercom response'); -}); +}; const sizeMatchesConstraints = (width: number, height: number) => ((width >= 600 && width <= 900) || (width >= 180 && width <= 430)) && height >= 60 && height <= 120;