diff --git a/client/src/page/feed.tsx b/client/src/page/feed.tsx index 0d3f53cc..f4118164 100644 --- a/client/src/page/feed.tsx +++ b/client/src/page/feed.tsx @@ -71,11 +71,12 @@ export function FeedPage({ id, TOC, clean }: { id: string, TOC: () => JSX.Elemen }) } function topFeed() { + const isUnTop = !(top > 0) const topNew = top === 0 ? 1 : 0; // Confirm showConfirm( - topNew === 1 ? t("article.top.title") : t("article.untop.title"), - topNew === 1 ? t("article.top.confirm") : t("article.untop.confirm"), + isUnTop ? t("article.top.title") : t("article.untop.title"), + isUnTop ? t("article.top.confirm") : t("article.untop.confirm"), () => { if (!feed) return; client @@ -89,7 +90,7 @@ export function FeedPage({ id, TOC, clean }: { id: string, TOC: () => JSX.Elemen if (error) { showAlert(error.value as string); } else { - showAlert(topNew === 1 ? t("article.top.success") : t("article.untop.success")); + showAlert(isUnTop ? t("article.top.success") : t("article.untop.success")); setTop(topNew); } }); @@ -224,7 +225,7 @@ export function FeedPage({ id, TOC, clean }: { id: string, TOC: () => JSX.Elemen {profile?.permission && (