mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Merge branch 'master' of gitlab.com:MrFry/qmining-page
This commit is contained in:
commit
195dfe0e12
1 changed files with 5 additions and 3 deletions
|
@ -93,10 +93,11 @@ export default function RankList({ globalData, globalState, setGlobalState }) {
|
||||||
const [ownEntryOnTop, setOwnEntryOnTop] = useState(false)
|
const [ownEntryOnTop, setOwnEntryOnTop] = useState(false)
|
||||||
|
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
|
console.log(globalState)
|
||||||
setSum()
|
setSum()
|
||||||
setRanklist(null)
|
setRanklist(null)
|
||||||
if (globalState.ranklist) {
|
if (globalState[`rankilst_${since}`]) {
|
||||||
const { list, sum, selfuserId } = globalState.ranklist
|
const { list, sum, selfuserId } = globalState[`rankilst_${since}`]
|
||||||
setRanklist(list || [])
|
setRanklist(list || [])
|
||||||
setSum(sum)
|
setSum(sum)
|
||||||
if (selfuserId) {
|
if (selfuserId) {
|
||||||
|
@ -105,6 +106,7 @@ export default function RankList({ globalData, globalState, setGlobalState }) {
|
||||||
} else {
|
} else {
|
||||||
getListFromServer(since)
|
getListFromServer(since)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
|
console.log(since)
|
||||||
const { list, sum, selfuserId } = data
|
const { list, sum, selfuserId } = data
|
||||||
setRanklist(list || [])
|
setRanklist(list || [])
|
||||||
setSum(sum)
|
setSum(sum)
|
||||||
|
@ -112,7 +114,7 @@ export default function RankList({ globalData, globalState, setGlobalState }) {
|
||||||
setSelfUserId(selfuserId)
|
setSelfUserId(selfuserId)
|
||||||
}
|
}
|
||||||
setGlobalState({
|
setGlobalState({
|
||||||
ranklist: data,
|
[`rankilst_${since}`]: data,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue