mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Typo fix, index minor fixes
This commit is contained in:
parent
26ae1bc2bb
commit
e15bc6a782
2 changed files with 22 additions and 16 deletions
|
@ -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 />
|
||||
}
|
||||
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue