diff --git a/src/locales/fa/translation.json b/src/locales/fa/translation.json index 200c92bfb..8b4239d19 100644 --- a/src/locales/fa/translation.json +++ b/src/locales/fa/translation.json @@ -136,4 +136,4 @@ "modal": { "close": "دکمه‌ی خروج" } -} \ No newline at end of file +} diff --git a/src/main/services/hosters/datanodes.ts b/src/main/services/hosters/datanodes.ts index d77e7d514..ae1444180 100644 --- a/src/main/services/hosters/datanodes.ts +++ b/src/main/services/hosters/datanodes.ts @@ -33,7 +33,8 @@ export class DatanodesApi { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36", }, - maxRedirects: 0, validateStatus: (status: number) => status === 302 || status < 400, + maxRedirects: 0, + validateStatus: (status: number) => status === 302 || status < 400, } ); diff --git a/src/renderer/src/pages/catalogue/catalogue.tsx b/src/renderer/src/pages/catalogue/catalogue.tsx index 42afeb116..652aaea58 100644 --- a/src/renderer/src/pages/catalogue/catalogue.tsx +++ b/src/renderer/src/pages/catalogue/catalogue.tsx @@ -32,8 +32,6 @@ const filterCategoryColors = { publishers: "hsl(200deg 50% 30%)", }; - - const PAGE_SIZE = 20; const TOTAL_ITEMS_TO_SHOW_GO_UP_BUTTOM = 10; const LIMIT_SCROLL_TO_DISAPEAR_GO_UP_BUTTON = 500; @@ -87,24 +85,26 @@ export default function Catalogue() { ).current; const isGoUpButtonVisible = (results: any[], scrollTop: number) => { - const withinLimit = results.length > 0 && results.length <= TOTAL_ITEMS_TO_SHOW_GO_UP_BUTTOM; + const withinLimit = + results.length > 0 && results.length <= TOTAL_ITEMS_TO_SHOW_GO_UP_BUTTOM; return withinLimit && scrollTop >= LIMIT_SCROLL_TO_DISAPEAR_GO_UP_BUTTON; }; useEffect(() => { - const withinLimit = results.length > 0 && results.length <= TOTAL_ITEMS_TO_SHOW_GO_UP_BUTTOM; + const withinLimit = + results.length > 0 && results.length <= TOTAL_ITEMS_TO_SHOW_GO_UP_BUTTOM; setWantGoUpButtonIsVisible(withinLimit); - }, [results]) + }, [results]); useEffect(() => { const handleScroll = debounce(() => { if (cataloguePageRef.current) { - const scrollTop = cataloguePageRef.current.scrollTop - setWantGoUpButtonIsVisible(isGoUpButtonVisible(results, scrollTop)) + const scrollTop = cataloguePageRef.current.scrollTop; + setWantGoUpButtonIsVisible(isGoUpButtonVisible(results, scrollTop)); } - }, 100) - - const ref = cataloguePageRef.current + }, 100); + + const ref = cataloguePageRef.current; if (ref) { ref.addEventListener("scroll", handleScroll); } @@ -378,12 +378,16 @@ export default function Catalogue() { {wantGoUpButtonIsVisible && ( - + )}