Skip to content

Commit

Permalink
Fix undefined issue and warnings (#943)
Browse files Browse the repository at this point in the history
* fix undefined

* remove warnings
  • Loading branch information
an-lee authored Aug 7, 2024
1 parent ab43225 commit 23742b8
Show file tree
Hide file tree
Showing 16 changed files with 41 additions and 16 deletions.
2 changes: 1 addition & 1 deletion enjoy/src/main/providers/youtube-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class YoutubeProvider {
videoId: video.richItemRenderer.content.videoRenderer.videoId,
duration:
video.richItemRenderer.content.videoRenderer.lengthText
.simpleText,
?.simpleText,
};
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ export const MediaCurrentRecording = () => {
</div>

<AlertDialog open={isSharing} onOpenChange={setIsSharing}>
<AlertDialogContent>
<AlertDialogContent aria-describedby={undefined}>
<AlertDialogHeader>
<AlertDialogTitle>{t("shareRecording")}</AlertDialogTitle>
<AlertDialogDescription>
Expand All @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
3 changes: 3 additions & 0 deletions enjoy/src/renderer/components/messages/assistant-message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
DropdownMenuTrigger,
DropdownMenuContent,
DropdownMenuItem,
SheetTitle,
} from "@renderer/components/ui";
import {
SpeechPlayer,
Expand Down Expand Up @@ -294,13 +295,15 @@ export const AssistantMessageComponent = (props: {
onOpenChange={(value) => setShadowing(value)}
>
<SheetContent
aria-describedby={undefined}
side="bottom"
className="h-screen p-0"
displayClose={false}
onPointerDownOutside={(event) => event.preventDefault()}
onInteractOutside={(event) => event.preventDefault()}
>
<SheetHeader className="flex items-center justify-center h-14">
<SheetTitle className="sr-only">{t("shadow")}</SheetTitle>
<SheetClose>
<ChevronDownIcon />
</SheetClose>
Expand Down
6 changes: 5 additions & 1 deletion enjoy/src/renderer/components/misc/bandu-login-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
6 changes: 5 additions & 1 deletion enjoy/src/renderer/components/misc/github-login-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
6 changes: 5 additions & 1 deletion enjoy/src/renderer/components/misc/mixin-login-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion enjoy/src/renderer/components/videos/ted-talks-segment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export const TedTalksSegment = () => {
if (!value) setSelectedTalk(null);
}}
>
<DialogContent>
<DialogContent aria-describedby={undefined}>
<DialogHeader>
<DialogTitle>{selectedTalk?.title}</DialogTitle>
</DialogHeader>
Expand Down
4 changes: 2 additions & 2 deletions enjoy/src/renderer/components/videos/videos-component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export const VideosComponent = () => {
setEditing(null);
}}
>
<DialogContent>
<DialogContent aria-describedby={undefined}>
<DialogHeader>
<DialogTitle>{t("editResource")}</DialogTitle>
</DialogHeader>
Expand All @@ -272,7 +272,7 @@ export const VideosComponent = () => {
setDeleting(null);
}}
>
<AlertDialogContent>
<AlertDialogContent aria-describedby={undefined}>
<AlertDialogHeader>
<AlertDialogTitle>{t("deleteResource")}</AlertDialogTitle>
<AlertDialogDescription>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion enjoy/src/renderer/pages/conversation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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")}
Expand Down
4 changes: 2 additions & 2 deletions enjoy/src/renderer/pages/conversations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export default () => {
</Button>
</DialogTrigger>

<DialogContent>
<DialogContent aria-describedby={undefined}>
<DialogHeader>
<DialogTitle>{t("selectAiRole")}</DialogTitle>
</DialogHeader>
Expand Down Expand Up @@ -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")}
Expand Down
3 changes: 2 additions & 1 deletion enjoy/src/renderer/pages/pronunciation-assessments/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -190,7 +191,7 @@ export default () => {
if (!value) setDeleting(null);
}}
>
<AlertDialogContent>
<AlertDialogContent aria-describedby={undefined}>
<AlertDialogHeader>
<AlertDialogTitle>{t("delete")}</AlertDialogTitle>
<AlertDialogDescription>
Expand Down

0 comments on commit 23742b8

Please sign in to comment.