修复接单平台标签刷新记忆
This commit is contained in:
@@ -26,7 +26,7 @@ type AfterSalesLocationState = {
|
||||
}
|
||||
|
||||
export default function AdminWorkerPlatformPage() {
|
||||
const [searchParams] = useSearchParams()
|
||||
const [searchParams, setSearchParams] = useSearchParams()
|
||||
const location = useLocation()
|
||||
const [activeTab, setActiveTab] = useState(() => loadActiveTab(searchParams.get('tab')))
|
||||
const afterSalesPanelRef = useRef<AfterSalesPanelHandle>(null)
|
||||
@@ -53,8 +53,16 @@ export default function AdminWorkerPlatformPage() {
|
||||
}, [location.state])
|
||||
|
||||
function changeTab(nextTab: string) {
|
||||
if (!isWorkerPlatformTab(nextTab)) return
|
||||
setActiveTab(nextTab)
|
||||
localStorage.setItem(ACTIVE_TAB_STORAGE_KEY, nextTab)
|
||||
setSearchParams(
|
||||
(current) => {
|
||||
current.set('tab', nextTab)
|
||||
return current
|
||||
},
|
||||
{ replace: true },
|
||||
)
|
||||
}
|
||||
|
||||
const afterSalesTab = {
|
||||
|
||||
Reference in New Issue
Block a user