mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
@@ -110,7 +110,9 @@ export const authApi = {
|
||||
},
|
||||
|
||||
// Request email change - sends verification code to new email
|
||||
requestEmailChange: async (newEmail: string): Promise<{ message: string }> => {
|
||||
requestEmailChange: async (
|
||||
newEmail: string,
|
||||
): Promise<{ message: string; new_email: string; expires_in_minutes: number }> => {
|
||||
const response = await apiClient.post('/cabinet/auth/email/change', {
|
||||
new_email: newEmail,
|
||||
});
|
||||
|
||||
@@ -454,6 +454,7 @@
|
||||
"trafficUnavailable": "Traffic purchase is not available for your tariff",
|
||||
"unlimited": "Unlimited",
|
||||
"buyTrafficGb": "Buy {{gb}} GB",
|
||||
"buyUnlimited": "Buy Unlimited",
|
||||
"manageServers": "Server management",
|
||||
"manageServersTitle": "Server management"
|
||||
},
|
||||
|
||||
@@ -328,6 +328,7 @@
|
||||
"trafficUnavailable": "خرید ترافیک برای اشتراک شما در دسترس نیست",
|
||||
"unlimited": "نامحدود",
|
||||
"buyTrafficGb": "خرید {{gb}} GB",
|
||||
"buyUnlimited": "خرید نامحدود",
|
||||
"manageServers": "مدیریت سرورها",
|
||||
"manageServersTitle": "مدیریت سرورها"
|
||||
},
|
||||
|
||||
@@ -481,6 +481,7 @@
|
||||
"trafficUnavailable": "Докупка трафика недоступна для вашего тарифа",
|
||||
"unlimited": "Безлимит",
|
||||
"buyTrafficGb": "Купить {{gb}} ГБ",
|
||||
"buyUnlimited": "Купить Безлимит",
|
||||
"manageServers": "Управление серверами",
|
||||
"manageServersTitle": "Управление серверами"
|
||||
},
|
||||
|
||||
@@ -328,6 +328,7 @@
|
||||
"trafficUnavailable": "您的套餐不支持购买流量",
|
||||
"unlimited": "无限制",
|
||||
"buyTrafficGb": "购买 {{gb}} GB",
|
||||
"buyUnlimited": "购买无限流量",
|
||||
"manageServers": "服务器管理",
|
||||
"manageServersTitle": "服务器管理"
|
||||
},
|
||||
|
||||
@@ -181,10 +181,17 @@ export default function Profile() {
|
||||
// Email change mutations
|
||||
const requestEmailChangeMutation = useMutation({
|
||||
mutationFn: (emailAddr: string) => authApi.requestEmailChange(emailAddr),
|
||||
onSuccess: () => {
|
||||
onSuccess: async (data) => {
|
||||
setChangeError(null);
|
||||
if (data.expires_in_minutes === 0) {
|
||||
// Unverified email was replaced directly
|
||||
setChangeEmailStep('success');
|
||||
const updatedUser = await authApi.getMe();
|
||||
setUser(updatedUser);
|
||||
} else {
|
||||
setChangeEmailStep('code');
|
||||
setResendCooldown(UI.RESEND_COOLDOWN_SEC);
|
||||
}
|
||||
},
|
||||
onError: (err: { response?: { data?: { detail?: string } } }) => {
|
||||
const detail = err.response?.data?.detail;
|
||||
|
||||
@@ -1588,7 +1588,7 @@ export default function Subscription() {
|
||||
))}
|
||||
</div>
|
||||
|
||||
{selectedTrafficPackage &&
|
||||
{selectedTrafficPackage !== null &&
|
||||
(() => {
|
||||
const selectedPkg = trafficPackages.find(
|
||||
(p) => p.gb === selectedTrafficPackage,
|
||||
@@ -1625,6 +1625,8 @@ export default function Subscription() {
|
||||
<span className="flex items-center justify-center gap-2">
|
||||
<span className="h-4 w-4 animate-spin rounded-full border-2 border-white/30 border-t-white" />
|
||||
</span>
|
||||
) : selectedPkg?.is_unlimited ? (
|
||||
t('subscription.additionalOptions.buyUnlimited')
|
||||
) : (
|
||||
t('subscription.additionalOptions.buyTrafficGb', {
|
||||
gb: selectedTrafficPackage,
|
||||
|
||||
Reference in New Issue
Block a user