Fix undefined issue and warnings (#943)

* fix undefined

* remove warnings
This commit is contained in:
an-lee
2024-08-07 14:22:31 +08:00
committed by GitHub
parent ab4322586c
commit 23742b8fdd
16 changed files with 41 additions and 16 deletions

View File

@@ -59,7 +59,7 @@ export class YoutubeProvider {
videoId: video.richItemRenderer.content.videoRenderer.videoId,
duration:
video.richItemRenderer.content.videoRenderer.lengthText
.simpleText,
?.simpleText,
};
});

View File

@@ -616,7 +616,7 @@ export const MediaCurrentRecording = () => {
</div>
<AlertDialog open={isSharing} onOpenChange={setIsSharing}>
<AlertDialogContent>
<AlertDialogContent aria-describedby={undefined}>
<AlertDialogHeader>
<AlertDialogTitle>{t("shareRecording")}</AlertDialogTitle>
<AlertDialogDescription>
@@ -634,6 +634,7 @@ export const MediaCurrentRecording = () => {
<Sheet open={detailIsOpen} onOpenChange={(open) => setDetailIsOpen(open)}>
<SheetContent
aria-describedby={undefined}
side="bottom"
className="rounded-t-2xl shadow-lg max-h-screen overflow-y-scroll"
displayClose={false}

View File

@@ -258,6 +258,7 @@ export const MediaTranscriptionReadButton = (props: {
}}
>
<SheetContent
aria-describedby={undefined}
side="bottom"
className="rounded-t-2xl shadow-lg max-h-screen overflow-y-scroll"
displayClose={false}

View File

@@ -11,6 +11,7 @@ import {
DropdownMenuTrigger,
DropdownMenuContent,
DropdownMenuItem,
SheetTitle,
} from "@renderer/components/ui";
import {
SpeechPlayer,
@@ -294,6 +295,7 @@ export const AssistantMessageComponent = (props: {
onOpenChange={(value) => setShadowing(value)}
>
<SheetContent
aria-describedby={undefined}
side="bottom"
className="h-screen p-0"
displayClose={false}
@@ -301,6 +303,7 @@ export const AssistantMessageComponent = (props: {
onInteractOutside={(event) => event.preventDefault()}
>
<SheetHeader className="flex items-center justify-center h-14">
<SheetTitle className="sr-only">{t("shadow")}</SheetTitle>
<SheetClose>
<ChevronDownIcon />
</SheetClose>

View File

@@ -33,7 +33,11 @@ export const BanduLoginButton = () => {
/>
</Button>
</SheetTrigger>
<SheetContent side="bottom" className="h-screen">
<SheetContent
side="bottom"
className="h-screen"
aria-describedby={undefined}
>
<div className="w-full h-full flex">
<div className="m-auto">{open && <BanduLoginForm />}</div>
</div>

View File

@@ -31,7 +31,11 @@ export const GithubLoginButton = () => {
/>
</Button>
</SheetTrigger>
<SheetContent side="bottom" className="h-screen">
<SheetContent
side="bottom"
className="h-screen"
aria-describedby={undefined}
>
<div className="w-full h-full flex">
<div className="m-auto">{open && <GithubLoginForm />}</div>
</div>

View File

@@ -32,7 +32,11 @@ export const MixinLoginButton = () => {
/>
</Button>
</SheetTrigger>
<SheetContent side="bottom" className="h-screen">
<SheetContent
side="bottom"
className="h-screen"
aria-describedby={undefined}
>
<div className="w-full h-full flex">
<div className="m-auto">{open && <MixinLoginForm />}</div>
</div>

View File

@@ -35,7 +35,7 @@ export const StoryPreviewToolbar = (props: {
<ScanTextIcon className="w-6 h-6" />
</ToolbarButton>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogContent aria-describedby={undefined}>
<AlertDialogHeader>
<AlertDialogTitle>{t("aiExtractVocabulary")}</AlertDialogTitle>

View File

@@ -43,7 +43,11 @@ export const StoryVocabularySheet = (props: {
if (!value) setVocabularyVisible(null);
}}
>
<SheetContent side="bottom" className="rounded-t-2xl shadow-lg h-5/6">
<SheetContent
side="bottom"
className="rounded-t-2xl shadow-lg h-5/6"
aria-describedby={undefined}
>
<SheetHeader className="flex items-center justify-center mb-2">
<div className="text-center">
<span className="font-semibold text-xl capitalize">

View File

@@ -75,7 +75,10 @@ export const TranscriptionEditButton = (props: {
</Button>
)}
</DialogTrigger>
<DialogContent className="max-w-screen-sm xl:max-w-screen-md">
<DialogContent
className="max-w-screen-sm xl:max-w-screen-md"
aria-describedby={undefined}
>
<DialogHeader>
<DialogTitle>{t("editTranscription")}</DialogTitle>
</DialogHeader>

View File

@@ -177,7 +177,7 @@ export const TedTalksSegment = () => {
if (!value) setSelectedTalk(null);
}}
>
<DialogContent>
<DialogContent aria-describedby={undefined}>
<DialogHeader>
<DialogTitle>{selectedTalk?.title}</DialogTitle>
</DialogHeader>

View File

@@ -252,7 +252,7 @@ export const VideosComponent = () => {
setEditing(null);
}}
>
<DialogContent>
<DialogContent aria-describedby={undefined}>
<DialogHeader>
<DialogTitle>{t("editResource")}</DialogTitle>
</DialogHeader>
@@ -272,7 +272,7 @@ export const VideosComponent = () => {
setDeleting(null);
}}
>
<AlertDialogContent>
<AlertDialogContent aria-describedby={undefined}>
<AlertDialogHeader>
<AlertDialogTitle>{t("deleteResource")}</AlertDialogTitle>
<AlertDialogDescription>

View File

@@ -119,7 +119,7 @@ export const YoutubeVideosSegment = (props: { channel: string }) => {
if (!value) setSelectedVideo(null);
}}
>
<DialogContent>
<DialogContent aria-describedby={undefined}>
<DialogHeader>
<DialogTitle>{t("downloadVideo")}</DialogTitle>
</DialogHeader>

View File

@@ -249,7 +249,7 @@ export default () => {
</div>
</SheetTrigger>
<SheetContent className="p-0">
<SheetContent className="p-0" aria-describedby={undefined}>
<SheetHeader>
<SheetTitle className="sr-only">
{t("editConversation")}

View File

@@ -235,7 +235,7 @@ export default () => {
</Button>
</DialogTrigger>
<DialogContent>
<DialogContent aria-describedby={undefined}>
<DialogHeader>
<DialogTitle>{t("selectAiRole")}</DialogTitle>
</DialogHeader>
@@ -302,7 +302,7 @@ export default () => {
</Dialog>
<Sheet open={creating} onOpenChange={(value) => setCreating(value)}>
<SheetContent className="p-0">
<SheetContent className="p-0" aria-describedby={undefined}>
<SheetHeader>
<SheetTitle className="sr-only">
{t("startConversation")}

View File

@@ -166,6 +166,7 @@ export default () => {
}}
>
<SheetContent
aria-describedby={undefined}
side="bottom"
className="rounded-t-2xl shadow-lg max-h-screen overflow-y-scroll"
displayClose={false}
@@ -190,7 +191,7 @@ export default () => {
if (!value) setDeleting(null);
}}
>
<AlertDialogContent>
<AlertDialogContent aria-describedby={undefined}>
<AlertDialogHeader>
<AlertDialogTitle>{t("delete")}</AlertDialogTitle>
<AlertDialogDescription>