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