fix(voices): 「去配音库上传」跳转自动打开上传弹窗 #1650
@@ -134,7 +134,7 @@ const Step5VoiceSelect: React.FC<Step5VoiceSelectProps> = ({
|
||||
|
||||
/** 跳转到配音库上传 */
|
||||
const handleGoToUpload = useCallback(() => {
|
||||
navigate("/app/voices")
|
||||
navigate("/app/voices?tab=material&upload=1")
|
||||
}, [navigate])
|
||||
|
||||
// 加载中状态
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
* 弹窗集合 → components/VoiceModals
|
||||
* Toast 提示 → components/VoiceToasts
|
||||
*/
|
||||
import React, { useCallback, useState } from "react"
|
||||
import React, { useCallback, useEffect, useState } from "react"
|
||||
import { useSearchParams } from "react-router-dom"
|
||||
import { UploadOutlined, AudioOutlined, RobotOutlined } from "@ant-design/icons"
|
||||
import { Button } from "@/components/ui"
|
||||
import PageHead from "@/components/layout/PageHead"
|
||||
@@ -158,6 +159,16 @@ const VoiceLibrary: React.FC = () => {
|
||||
handleUploadClose,
|
||||
} = useVoiceUpload({ showToast })
|
||||
|
||||
// ── URL 参数自动打开上传弹窗 ────────────────────────────
|
||||
const [searchParams] = useSearchParams()
|
||||
|
||||
useEffect(() => {
|
||||
if (searchParams.get("upload") === "1") {
|
||||
setActiveTab("material")
|
||||
setUploadOpen(true)
|
||||
}
|
||||
}, [searchParams, setActiveTab, setUploadOpen])
|
||||
|
||||
// ── 切换 Tab 时停止播放 ───────────────────────────────
|
||||
const handleTabChange = useCallback(
|
||||
(tab: VoiceTabKey) => {
|
||||
|
||||
Reference in New Issue
Block a user