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 getList = () => {
|
||||
console.log(globalState)
|
||||
setSum()
|
||||
setRanklist(null)
|
||||
if (globalState.ranklist) {
|
||||
const { list, sum, selfuserId } = globalState.ranklist
|
||||
if (globalState[`rankilst_${since}`]) {
|
||||
const { list, sum, selfuserId } = globalState[`rankilst_${since}`]
|
||||
setRanklist(list || [])
|
||||
setSum(sum)
|
||||
if (selfuserId) {
|
||||
|
@ -105,6 +106,7 @@ export default function RankList({ globalData, globalState, setGlobalState }) {
|
|||
} else {
|
||||
getListFromServer(since)
|
||||
.then((data) => {
|
||||
console.log(since)
|
||||
const { list, sum, selfuserId } = data
|
||||
setRanklist(list || [])
|
||||
setSum(sum)
|
||||
|
@ -112,7 +114,7 @@ export default function RankList({ globalData, globalState, setGlobalState }) {
|
|||
setSelfUserId(selfuserId)
|
||||
}
|
||||
setGlobalState({
|
||||
ranklist: data,
|
||||
[`rankilst_${since}`]: data,
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue