Skip to content

Commit

Permalink
fix: 🐛 fix: tag ui scaling bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Charlie committed Aug 31, 2024
1 parent 3be3f92 commit 52a81ac
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
25 changes: 17 additions & 8 deletions packages/renderer/src/components/DownloadForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,13 @@ const DownloadForm = forwardRef<DownloadFormRef, DownloadFormProps>(
try {
await form.validateFields();
const values = form.getFieldsValue();
const close = await onAddToList(values);
if (close) {
setModalOpen(false);
try {
const close = await onAddToList(values);
if (close) {
setModalOpen(false);
}
} catch (error) {
messageApi.error(t("pleaseEnterCorrectFomeInfo"));
}
} catch (e: any) {
messageApi.error(e?.message);
Expand All @@ -247,12 +251,16 @@ const DownloadForm = forwardRef<DownloadFormRef, DownloadFormProps>(
try {
await form.validateFields();
const values = form.getFieldsValue();
const close = await onDownloadNow(values);
if (close) {
setModalOpen(false);
try {
const close = await onDownloadNow(values);
if (close) {
setModalOpen(false);
}
} catch (e: any) {
messageApi.error(e?.message);
}
} catch (e: any) {
messageApi.error(e?.message);
messageApi.error(t("pleaseEnterCorrectFomeInfo"));
}
}}
>
Expand All @@ -279,6 +287,7 @@ const DownloadForm = forwardRef<DownloadFormRef, DownloadFormProps>(
rules={[
{
required: true,
message: t("pleaseEnterVideoName"),
},
]}
>
Expand Down Expand Up @@ -310,7 +319,7 @@ const DownloadForm = forwardRef<DownloadFormRef, DownloadFormProps>(
rules={[
{
required: true,
message: t("pleaseEnterVideoName"),
message: t("pleaseEnterCorrectFomeInfo"),
},
]}
tooltip={canChangeType && t("canUseMouseWheelToAdjust")}
Expand Down
2 changes: 1 addition & 1 deletion packages/renderer/src/components/DownloadTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function DownloadTag({ icon, text, color }: DownloadTagProps) {
return (
<div
className={cn(
"flex flex-row items-center gap-[3px] rounded-2xl rounded-bl-lg pl-1 pr-2",
"flex flex-shrink-0 flex-row items-center gap-[3px] rounded-2xl rounded-bl-lg pl-1 pr-2",
)}
style={{ background: color }}
>
Expand Down
2 changes: 2 additions & 0 deletions packages/renderer/src/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ i18n
pleaseEnterVideoLink: "Please enter video link",
videoName: "Video Name",
pleaseEnterVideoName: "Please enter video name",
pleaseEnterCorrectFomeInfo: "Please enter the correct information",
additionalHeaders: "Additional Headers",
pleaseEnterOnlineVideoUrl: "Please enter online network video URL",
pleaseEnterCorrectVideoLink: "Please enter correct video link",
Expand Down Expand Up @@ -235,6 +236,7 @@ Referer: http://www.example.com`,
pleaseEnterVideoLink: "请输入站点视频链接",
videoName: "视频名称",
pleaseEnterVideoName: "请输入视频名称",
pleaseEnterCorrectFomeInfo: "请输入正确的表单信息",
additionalHeaders: "附加标头",
pleaseEnterOnlineVideoUrl: "请输入在线网络视频URL",
pleaseEnterCorrectVideoLink: "请输入正确的视频链接",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,11 @@ export function DownloadList({
onDownloadItems={onDownloadItems}
onCancelItems={onCancelItems}
/>
<div className={cn("flex w-full flex-1 flex-col gap-3 overflow-auto")}>
<div
className={cn(
"flex w-full flex-1 flex-shrink-0 flex-col gap-3 overflow-auto",
)}
>
{data.map((item) => {
let currProgress;
if (
Expand Down

0 comments on commit 52a81ac

Please sign in to comment.