mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-28 21:42:27 +08:00
fix(video): prevent thumbnail update for queued/in_progress videos
When a video is in 'queued' or 'in_progress' status, setting a thumbnail is not meaningful and could cause issues. This change ensures thumbnail remains undefined for these states.
This commit is contained in:
parent
09ed82eb49
commit
4e76806cc3
@ -39,7 +39,14 @@ const videoSlice = createSlice({
|
||||
if (videos) {
|
||||
let video = videos.find((v) => v.id === update.id)
|
||||
if (video) {
|
||||
video = { ...video, ...update }
|
||||
switch (video.status) {
|
||||
case 'queued':
|
||||
case 'in_progress':
|
||||
video = { ...video, ...update, thumbnail: undefined }
|
||||
break
|
||||
default:
|
||||
video = { ...video, ...update }
|
||||
}
|
||||
} else {
|
||||
logger.error(`Video with id ${update.id} not found in ${providerId}`)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user