diff --git a/src/locales/en.json b/src/locales/en.json index 268b2c1..3651a40 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -4218,6 +4218,7 @@ "activateSuccess": "Gift activated!", "activateSuccessDesc": "{{tariff}} — {{days}} days added to your subscription", "activateError": "Failed to activate gift", + "activateSelfError": "You cannot activate your own gift", "myGiftsEmpty": "No gifts yet", "myGiftsEmptyDesc": "Buy a gift for a friend or activate a received code", "sentGiftsTitle": "Sent", diff --git a/src/locales/ru.json b/src/locales/ru.json index 55be595..2abab43 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -4782,6 +4782,7 @@ "activateSuccess": "Подарок активирован!", "activateSuccessDesc": "{{tariff}} — {{days}} дн. добавлено к вашей подписке", "activateError": "Не удалось активировать подарок", + "activateSelfError": "Нельзя активировать свой собственный подарок", "myGiftsEmpty": "У вас пока нет подарков", "myGiftsEmptyDesc": "Купите подарок для друга или активируйте полученный код", "sentGiftsTitle": "Отправленные", diff --git a/src/pages/GiftSubscription.tsx b/src/pages/GiftSubscription.tsx index 2a23153..12c9121 100644 --- a/src/pages/GiftSubscription.tsx +++ b/src/pages/GiftSubscription.tsx @@ -869,7 +869,11 @@ function ActivateTabContent({ initialCode }: { initialCode?: string | null }) { queryClient.invalidateQueries({ queryKey: ['balance'] }); }, onError: (err) => { - const msg = getApiErrorMessage(err, t('gift.activateError')); + const raw = getApiErrorMessage(err, ''); + const msg = + raw === 'Cannot activate your own gift' + ? t('gift.activateSelfError') + : raw || t('gift.activateError'); setActivateError(msg); }, });