Feat/explore (#198)

This commit is contained in:
Joel
2023-05-25 16:59:47 +08:00
committed by GitHub
parent b6cca59517
commit 33b3eaf324
38 changed files with 1312 additions and 97 deletions

View File

@@ -8,6 +8,7 @@ import NewAppCard from './NewAppCard'
import { AppListResponse } from '@/models/app'
import { fetchAppList } from '@/service/apps'
import { useSelector } from '@/context/app-context'
import { NEED_REFRESH_APP_LIST_KEY } from '@/config'
const getKey = (pageIndex: number, previousPageData: AppListResponse) => {
if (!pageIndex || previousPageData.has_more)
@@ -21,6 +22,13 @@ const Apps = () => {
const pageContainerRef = useSelector(state => state.pageContainerRef)
const anchorRef = useRef<HTMLAnchorElement>(null)
useEffect(() => {
if(localStorage.getItem(NEED_REFRESH_APP_LIST_KEY) === '1') {
localStorage.removeItem(NEED_REFRESH_APP_LIST_KEY)
mutate()
}
}, [])
useEffect(() => {
loadingStateRef.current = isLoading
}, [isLoading])