mirror of
https://github.com/p-stream/p-stream.git
synced 2026-04-21 08:52:22 +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 { t } = useTranslation();
|
||||||
const setCaption = usePlayerStore((s) => s.setCaption);
|
const setCaption = usePlayerStore((s) => s.setCaption);
|
||||||
const setCustomSubs = useSubtitleStore((s) => s.setCustomSubs);
|
const setCustomSubs = useSubtitleStore((s) => s.setCustomSubs);
|
||||||
|
|
@ -267,7 +267,7 @@ export function PasteCaptionOption() {
|
||||||
setCaption({
|
setCaption({
|
||||||
language: parsedData.language,
|
language: parsedData.language,
|
||||||
srtData: converted,
|
srtData: converted,
|
||||||
id: parsedData.id,
|
id: "pasted-caption",
|
||||||
});
|
});
|
||||||
setCustomSubs();
|
setCustomSubs();
|
||||||
|
|
||||||
|
|
@ -286,7 +286,12 @@ export function PasteCaptionOption() {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CaptionOption onClick={handlePaste} loading={isLoading} error={error}>
|
<CaptionOption
|
||||||
|
onClick={handlePaste}
|
||||||
|
loading={isLoading}
|
||||||
|
error={error}
|
||||||
|
selected={props.selected}
|
||||||
|
>
|
||||||
{t("player.menus.subtitles.pasteChoice")}
|
{t("player.menus.subtitles.pasteChoice")}
|
||||||
</CaptionOption>
|
</CaptionOption>
|
||||||
);
|
);
|
||||||
|
|
@ -532,7 +537,9 @@ export function CaptionsView({
|
||||||
<CustomCaptionOption />
|
<CustomCaptionOption />
|
||||||
|
|
||||||
{/* Paste subtitle option */}
|
{/* Paste subtitle option */}
|
||||||
<PasteCaptionOption />
|
<PasteCaptionOption
|
||||||
|
selected={selectedCaptionId === "pasted-caption"}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="h-1" />
|
<div className="h-1" />
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue