Skip to content

Commit f2cd1ff

Browse files
authored
fix(console): fix payment page cannot open in iOS Safari issue (#7445)
1 parent 54867d1 commit f2cd1ff

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/console/src/hooks/use-subscribe.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,18 @@ const useSubscribe = () => {
115115

116116
const visitManagePaymentPage = async (tenantId: string) => {
117117
try {
118+
const currentUrl = window.location.href;
118119
const { redirectUri } = await cloudApi.post('/api/tenants/:tenantId/stripe-customer-portal', {
119120
params: {
120121
tenantId,
121122
},
122123
body: {
123-
callbackUrl: window.location.href,
124+
callbackUrl: currentUrl,
124125
},
125126
});
126127

127-
window.open(redirectUri, '_blank', 'noopener,noreferrer');
128+
// eslint-disable-next-line @silverhand/fp/no-mutation
129+
window.location.href = redirectUri;
128130
} catch (error: unknown) {
129131
void toastResponseError(error);
130132
}

0 commit comments

Comments
 (0)