🐛 fixed : 跳过异常新闻和选中新闻一致时直接关闭

This commit is contained in:
LittleBoy 2025-03-08 22:15:54 +08:00
parent 0bf20343d0
commit 45b0912d48

View File

@ -31,9 +31,13 @@ export default function ButtonPush2Video(props: PushVideoProps) {
const {t} = useTranslation()
const navigate = useNavigate()
const handlePush = (action: ProcessResult) => {
setLoading(true)
const skip = action === ProcessResult.Skip && state.errorIds.length > 0
const ids = !skip ? props.ids : props.ids.filter(id => !state.errorIds.includes(id));
if(skip && (state.errorIds.length == props.ids.length || ids.length == 0)){
setState({modalVisible: false})
return;
}
setLoading(true)
push2video(ids).then(() => {
setState({modalVisible: false})
if (skip) {