From 7b5367a9a99ac8ae608a765b79a66c1f7380dcd8 Mon Sep 17 00:00:00 2001 From: "web@ppanel" Date: Mon, 22 Dec 2025 04:38:16 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20Add=20onSuccess=20callbac?= =?UTF-8?q?k=20to=20Unsubscribe=20component=20and=20conditionally=20render?= =?UTF-8?q?=20Renewal=20component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/user/src/sections/subscribe/unsubscribe.tsx | 3 +++ apps/user/src/sections/user/dashboard/content.tsx | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/user/src/sections/subscribe/unsubscribe.tsx b/apps/user/src/sections/subscribe/unsubscribe.tsx index 5f73252..eb50772 100644 --- a/apps/user/src/sections/subscribe/unsubscribe.tsx +++ b/apps/user/src/sections/subscribe/unsubscribe.tsx @@ -21,11 +21,13 @@ import { useGlobalStore } from "@/stores/global"; interface UnsubscribeProps { id: number; allowDeduction?: boolean; + onSuccess?: () => void; } export default function Unsubscribe({ id, allowDeduction, + onSuccess, }: Readonly) { const { t } = useTranslation("subscribe"); const { common, getUserInfo } = useGlobalStore(); @@ -52,6 +54,7 @@ export default function Unsubscribe({ ); toast.success(t("unsubscribe.success", "Unsubscribed successfully")); await getUserInfo(); + onSuccess?.(); setOpen(false); } catch (_error) { toast.error(t("unsubscribe.failed", "Unsubscribe failed")); diff --git a/apps/user/src/sections/user/dashboard/content.tsx b/apps/user/src/sections/user/dashboard/content.tsx index 9166e64..9d3eff4 100644 --- a/apps/user/src/sections/user/dashboard/content.tsx +++ b/apps/user/src/sections/user/dashboard/content.tsx @@ -313,11 +313,13 @@ export default function Content() { id={item.id} replacement={item.subscribe.replacement} /> - - + {item.expire_time !== 0 && ( + + )} )}