From a4cb9f0cf980cd1861377c4e046b650f8253959a Mon Sep 17 00:00:00 2001 From: yun-zhi-ztl <15071461069@163.com> Date: Thu, 19 Mar 2026 10:54:32 +0800 Subject: [PATCH] fix(web): disable report button after successful submission --- web/src/i18n/locales/en.json | 1 + web/src/i18n/locales/zh.json | 1 + web/src/pages/skill-detail.tsx | 6 ++++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/web/src/i18n/locales/en.json b/web/src/i18n/locales/en.json index 39f4d5e2..c738818e 100644 --- a/web/src/i18n/locales/en.json +++ b/web/src/i18n/locales/en.json @@ -695,6 +695,7 @@ "promotionAlreadyPromotedDescription": "This skill has already been promoted to the global namespace.", "promotionErrorTitle": "Failed to submit promotion request", "reportSkill": "Report Skill", + "reportedSkill": "Reported", "reportDialogTitle": "Report skill", "reportDialogDescription": "Provide a reason so administrators can review and act on it quickly.", "reportReasonPlaceholder": "Reason, for example policy violation, misleading content, or infringement", diff --git a/web/src/i18n/locales/zh.json b/web/src/i18n/locales/zh.json index 01651211..aecfb793 100644 --- a/web/src/i18n/locales/zh.json +++ b/web/src/i18n/locales/zh.json @@ -695,6 +695,7 @@ "promotionAlreadyPromotedDescription": "这个技能已经提升到全局命名空间,无需重复提交。", "promotionErrorTitle": "提交提升申请失败", "reportSkill": "举报技能", + "reportedSkill": "已举报", "reportDialogTitle": "举报技能", "reportDialogDescription": "请填写举报原因,帮助管理员快速判断和处理。", "reportReasonPlaceholder": "举报原因,例如包含违规内容、恶意误导、侵权等", diff --git a/web/src/pages/skill-detail.tsx b/web/src/pages/skill-detail.tsx index aed3dbe3..ec792bef 100644 --- a/web/src/pages/skill-detail.tsx +++ b/web/src/pages/skill-detail.tsx @@ -93,6 +93,7 @@ export function SkillDetailPage() { const [reportDialogOpen, setReportDialogOpen] = useState(false) const [reportReason, setReportReason] = useState('') const [reportDetails, setReportDetails] = useState('') + const [hasReported, setHasReported] = useState(false) const [archiveConfirmOpen, setArchiveConfirmOpen] = useState(false) const [unarchiveConfirmOpen, setUnarchiveConfirmOpen] = useState(false) const [promotionConfirmOpen, setPromotionConfirmOpen] = useState(false) @@ -288,6 +289,7 @@ export function SkillDetailPage() { setReportDialogOpen(false) setReportReason('') setReportDetails('') + setHasReported(true) toast.success(t('skillDetail.reportSuccessTitle'), t('skillDetail.reportSuccessDescription')) } catch (error) { toast.error(t(resolveSkillActionErrorTitle('report')), error instanceof Error ? error.message : '') @@ -788,8 +790,8 @@ export function SkillDetailPage() { {canReport ? ( - ) : null}