fix apps category history behavior

This commit is contained in:
yyh 2025-12-26 15:13:33 +08:00
parent 073d0aa2d0
commit 9f3a148732
No known key found for this signature in database
1 changed files with 5 additions and 4 deletions

View File

@ -13,7 +13,7 @@ import dynamic from 'next/dynamic'
import {
useRouter,
} from 'next/navigation'
import { useQueryState } from 'nuqs'
import { parseAsString, useQueryState } from 'nuqs'
import { useCallback, useEffect, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import Input from '@/app/components/base/input'
@ -47,9 +47,10 @@ const List = () => {
const router = useRouter()
const { isCurrentWorkspaceEditor, isCurrentWorkspaceDatasetOperator } = useAppContext()
const showTagManagementModal = useTagStore(s => s.showTagManagementModal)
const [activeTab, setActiveTab] = useQueryState('category', {
defaultValue: 'all',
})
const [activeTab, setActiveTab] = useQueryState(
'category',
parseAsString.withDefault('all').withOptions({ history: 'push' }),
)
const { query: { tagIDs = [], keywords = '', isCreatedByMe: queryIsCreatedByMe = false }, setQuery } = useAppsQueryState()
const [isCreatedByMe, setIsCreatedByMe] = useState(queryIsCreatedByMe)
const [tagFilterValue, setTagFilterValue] = useState<string[]>(tagIDs)