Typo fix, index minor fixes

This commit is contained in:
mrfry 2022-04-02 15:06:43 +02:00
parent 26ae1bc2bb
commit e15bc6a782
2 changed files with 22 additions and 16 deletions

View file

@ -83,7 +83,7 @@ function fetchLeaderboard() {
resolve(res) resolve(res)
}) })
}) })
}) }, { staleTime: Infinity })
return data || [] return data || []
} }
@ -190,6 +190,8 @@ const NewsEntryContainer = ({
onTitleClick, onTitleClick,
}) => { }) => {
const [error, setError] = useState(false) const [error, setError] = useState(false)
useEffect(() => {
if (!newsEntryData && !error) { if (!newsEntryData && !error) {
fetchEntry(postKey) fetchEntry(postKey)
.then((res) => { .then((res) => {
@ -205,6 +207,10 @@ const NewsEntryContainer = ({
console.error(e) console.error(e)
setError(true) setError(true)
}) })
}
}, [])
if (!newsEntryData) {
return <LoadingIndicator /> return <LoadingIndicator />
} }

View file

@ -9,7 +9,7 @@ import ExternalLinkIcon from '../components/externalLinkIcon'
import styles from './script.module.css' import styles from './script.module.css'
function fetchSurouter.pathnamepportedSites() { function fetchSupportedSites() {
return new Promise((resolve) => { return new Promise((resolve) => {
fetch(`${constants.apiUrl}supportedSites`, { fetch(`${constants.apiUrl}supportedSites`, {
credentials: 'include', credentials: 'include',