feat: implement lazy singleton pattern for repository instances and update related imports

This commit is contained in:
2026-06-29 17:25:41 +08:00
parent 96612da5c0
commit 0bae53bfba
14 changed files with 69 additions and 74 deletions
+2 -2
View File
@@ -16,7 +16,7 @@ import Link from "next/link";
import { useRouter } from "next/navigation";
import { MobileShell } from "@/app/_components/core/mobile-shell";
import { paymentRepository } from "@/data/repositories/payment_repository";
import { getPaymentRepository } from "@/data/repositories/payment_repository";
import { ROUTES } from "@/router/routes";
export default function SubscriptionSuccessPage() {
@@ -33,7 +33,7 @@ export default function SubscriptionSuccessPage() {
let cancelled = false;
const tryRefresh = async (attemptsLeft: number) => {
if (cancelled) return;
const r = await paymentRepository.getVipStatus();
const r = await getPaymentRepository().getVipStatus();
if (cancelled) return;
if (r.success) {
if (r.data.isVip) {