diff --git a/src/renderer/src/pages/video/VideoPage.tsx b/src/renderer/src/pages/video/VideoPage.tsx
index e554252d8..eb09dd371 100644
--- a/src/renderer/src/pages/video/VideoPage.tsx
+++ b/src/renderer/src/pages/video/VideoPage.tsx
@@ -144,7 +144,13 @@ export const VideoPage = () => {
{provider.type === 'openai-response' && }
-
+
{/* Video list */}
>) => void
+ setActiveVideoId: (id: string) => void
}
const logger = loggerService.withContext('VideoPanel')
-export const VideoPanel = ({ provider, video, params, updateParams }: VideoPanelProps) => {
+export const VideoPanel = ({ provider, video, params, updateParams, setActiveVideoId }: VideoPanelProps) => {
const { t } = useTranslation()
const addOpenAIVideo = useAddOpenAIVideo(provider.id)
const { setVideo } = useProviderVideos(provider.id)
const { pendingMap, setPending: setPendingById } = usePending()
+ const [isProcessing, setIsProcessing] = useState()
const fileInputRef = useRef(null)
const inputReference = params.params.input_reference
@@ -56,11 +58,13 @@ export const VideoPanel = ({ provider, video, params, updateParams }: VideoPanel
}
}, [updateParams, video])
- const isPending = video ? pendingMap[video.id] : false
+ const isPending = (video ? pendingMap[video.id] : false) || isProcessing
const setPending = useCallback(
(value: boolean) => {
if (video) {
setPendingById(video.id, value ? value : undefined)
+ } else {
+ setIsProcessing(value)
}
},
[setPendingById, video]
@@ -80,6 +84,7 @@ export const VideoPanel = ({ provider, video, params, updateParams }: VideoPanel
default:
logger.error(`Invalid video type ${result.type}.`)
}
+ setActiveVideoId(result.video.id)
} else {
// TODO: remix video
window.toast.info('Remix video is not implemented.')