mirror of
https://github.com/p-stream/p-stream.git
synced 2026-01-11 20:10:32 +00:00
show check for pasted subtitle option
This commit is contained in:
parent
b5b53a90f5
commit
235a6998db
1 changed files with 11 additions and 4 deletions
|
|
@ -227,7 +227,7 @@ export function CustomCaptionOption() {
|
|||
);
|
||||
}
|
||||
|
||||
export function PasteCaptionOption() {
|
||||
export function PasteCaptionOption(props: { selected?: boolean }) {
|
||||
const { t } = useTranslation();
|
||||
const setCaption = usePlayerStore((s) => s.setCaption);
|
||||
const setCustomSubs = useSubtitleStore((s) => s.setCustomSubs);
|
||||
|
|
@ -267,7 +267,7 @@ export function PasteCaptionOption() {
|
|||
setCaption({
|
||||
language: parsedData.language,
|
||||
srtData: converted,
|
||||
id: parsedData.id,
|
||||
id: "pasted-caption",
|
||||
});
|
||||
setCustomSubs();
|
||||
|
||||
|
|
@ -286,7 +286,12 @@ export function PasteCaptionOption() {
|
|||
};
|
||||
|
||||
return (
|
||||
<CaptionOption onClick={handlePaste} loading={isLoading} error={error}>
|
||||
<CaptionOption
|
||||
onClick={handlePaste}
|
||||
loading={isLoading}
|
||||
error={error}
|
||||
selected={props.selected}
|
||||
>
|
||||
{t("player.menus.subtitles.pasteChoice")}
|
||||
</CaptionOption>
|
||||
);
|
||||
|
|
@ -532,7 +537,9 @@ export function CaptionsView({
|
|||
<CustomCaptionOption />
|
||||
|
||||
{/* Paste subtitle option */}
|
||||
<PasteCaptionOption />
|
||||
<PasteCaptionOption
|
||||
selected={selectedCaptionId === "pasted-caption"}
|
||||
/>
|
||||
|
||||
<div className="h-1" />
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue