refactor(routes): move shared pages to global scope

This commit is contained in:
2026-07-20 14:02:15 +08:00
parent b216b53f2e
commit 1f7ab2be04
36 changed files with 743 additions and 251 deletions
@@ -19,7 +19,7 @@ export interface UseSubscriptionPaymentFlowInput {
shouldResumePendingOrder: boolean;
returnTo: SubscriptionReturnTo;
initialPayChannel: PayChannel;
characterSlug?: string;
sourceCharacterSlug?: string;
}
export function useSubscriptionPaymentFlow({
@@ -27,7 +27,7 @@ export function useSubscriptionPaymentFlow({
shouldResumePendingOrder,
returnTo,
initialPayChannel,
characterSlug = DEFAULT_CHARACTER_SLUG,
sourceCharacterSlug = DEFAULT_CHARACTER_SLUG,
}: UseSubscriptionPaymentFlowInput) {
const router = useRouter();
const { payment, paymentDispatch } = usePaymentRouteFlow({
@@ -50,7 +50,7 @@ export function useSubscriptionPaymentFlow({
const handleBackClick = () => {
void (async () => {
router.replace(
await consumeSubscriptionExitUrl(returnTo, characterSlug),
await consumeSubscriptionExitUrl(returnTo, sourceCharacterSlug),
);
})();
};
@@ -60,7 +60,10 @@ export function useSubscriptionPaymentFlow({
paymentDispatch({ type: "PaymentReset" });
void (async () => {
router.replace(
await resolveSubscriptionSuccessExitUrl(returnTo, characterSlug),
await resolveSubscriptionSuccessExitUrl(
returnTo,
sourceCharacterSlug,
),
);
})();
};