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)
|
resolve(res)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
}, { staleTime: Infinity })
|
||||||
return data || []
|
return data || []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,21 +190,27 @@ const NewsEntryContainer = ({
|
||||||
onTitleClick,
|
onTitleClick,
|
||||||
}) => {
|
}) => {
|
||||||
const [error, setError] = useState(false)
|
const [error, setError] = useState(false)
|
||||||
if (!newsEntryData && !error) {
|
|
||||||
fetchEntry(postKey)
|
useEffect(() => {
|
||||||
.then((res) => {
|
if (!newsEntryData && !error) {
|
||||||
const { success, entry, msg } = res
|
fetchEntry(postKey)
|
||||||
if (success) {
|
.then((res) => {
|
||||||
setNews({ [postKey]: entry, ...news })
|
const { success, entry, msg } = res
|
||||||
} else {
|
if (success) {
|
||||||
alert(msg)
|
setNews({ [postKey]: entry, ...news })
|
||||||
|
} else {
|
||||||
|
alert(msg)
|
||||||
|
setError(true)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
console.error(e)
|
||||||
setError(true)
|
setError(true)
|
||||||
}
|
})
|
||||||
})
|
}
|
||||||
.catch((e) => {
|
}, [])
|
||||||
console.error(e)
|
|
||||||
setError(true)
|
if (!newsEntryData) {
|
||||||
})
|
|
||||||
return <LoadingIndicator />
|
return <LoadingIndicator />
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue