max 1 subtitle file (#5244)

zio/stable
Samuel Newman 2024-09-10 02:02:53 +01:00 committed by GitHub
parent 436e30fded
commit 0f6be244a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -20,6 +20,8 @@ import {Warning_Stroke2_Corner0_Rounded as WarningIcon} from '#/components/icons
import {Text} from '#/components/Typography' import {Text} from '#/components/Typography'
import {SubtitleFilePicker} from './SubtitleFilePicker' import {SubtitleFilePicker} from './SubtitleFilePicker'
const MAX_NUM_CAPTIONS = 1
interface Props { interface Props {
defaultAltText: string defaultAltText: string
captions: {lang: string; file: File}[] captions: {lang: string; file: File}[]
@ -134,7 +136,9 @@ function SubtitleDialogInner({
</Text> </Text>
<SubtitleFilePicker <SubtitleFilePicker
onSelectFile={handleSelectFile} onSelectFile={handleSelectFile}
disabled={subtitleMissingLanguage || captions.length >= 4} disabled={
subtitleMissingLanguage || captions.length >= MAX_NUM_CAPTIONS
}
/> />
<View> <View>
{captions.map((subtitle, i) => ( {captions.map((subtitle, i) => (