From e15bc6a782e02e9d2f0c6348bc82f8928b503c51 Mon Sep 17 00:00:00 2001
From: mrfry <mr.fry@tutanota.com>
Date: Sat, 2 Apr 2022 15:06:43 +0200
Subject: [PATCH] Typo fix, index minor fixes

---
 src/pages/index.js  | 36 +++++++++++++++++++++---------------
 src/pages/script.js |  2 +-
 2 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/src/pages/index.js b/src/pages/index.js
index ddcf724..3414532 100644
--- a/src/pages/index.js
+++ b/src/pages/index.js
@@ -83,7 +83,7 @@ function fetchLeaderboard() {
           resolve(res)
         })
     })
-  })
+  }, { staleTime: Infinity })
   return data || []
 }
 
@@ -190,21 +190,27 @@ const NewsEntryContainer = ({
   onTitleClick,
 }) => {
   const [error, setError] = useState(false)
-  if (!newsEntryData && !error) {
-    fetchEntry(postKey)
-      .then((res) => {
-        const { success, entry, msg } = res
-        if (success) {
-          setNews({ [postKey]: entry, ...news })
-        } else {
-          alert(msg)
+
+  useEffect(() => {
+    if (!newsEntryData && !error) {
+      fetchEntry(postKey)
+        .then((res) => {
+          const { success, entry, msg } = res
+          if (success) {
+            setNews({ [postKey]: entry, ...news })
+          } else {
+            alert(msg)
+            setError(true)
+          }
+        })
+        .catch((e) => {
+          console.error(e)
           setError(true)
-        }
-      })
-      .catch((e) => {
-        console.error(e)
-        setError(true)
-      })
+        })
+    }
+  }, [])
+
+  if (!newsEntryData) {
     return <LoadingIndicator />
   }
 
diff --git a/src/pages/script.js b/src/pages/script.js
index d5f8f40..962ca09 100644
--- a/src/pages/script.js
+++ b/src/pages/script.js
@@ -9,7 +9,7 @@ import ExternalLinkIcon from '../components/externalLinkIcon'
 
 import styles from './script.module.css'
 
-function fetchSurouter.pathnamepportedSites() {
+function fetchSupportedSites() {
   return new Promise((resolve) => {
     fetch(`${constants.apiUrl}supportedSites`, {
       credentials: 'include',