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