Skip to content

Commit

Permalink
max 1 subtitle file (#5244)
Browse files Browse the repository at this point in the history
  • Loading branch information
mozzius authored Sep 10, 2024
1 parent 436e30f commit 0f6be24
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/view/com/composer/videos/SubtitleDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import {Warning_Stroke2_Corner0_Rounded as WarningIcon} from '#/components/icons
import {Text} from '#/components/Typography'
import {SubtitleFilePicker} from './SubtitleFilePicker'

const MAX_NUM_CAPTIONS = 1

interface Props {
defaultAltText: string
captions: {lang: string; file: File}[]
Expand Down Expand Up @@ -134,7 +136,9 @@ function SubtitleDialogInner({
</Text>
<SubtitleFilePicker
onSelectFile={handleSelectFile}
disabled={subtitleMissingLanguage || captions.length >= 4}
disabled={
subtitleMissingLanguage || captions.length >= MAX_NUM_CAPTIONS
}
/>
<View>
{captions.map((subtitle, i) => (
Expand Down

0 comments on commit 0f6be24

Please sign in to comment.