diff --git a/frontend/src/i18n/en.ts b/frontend/src/i18n/en.ts index 5afb9e16..9fd0279c 100644 --- a/frontend/src/i18n/en.ts +++ b/frontend/src/i18n/en.ts @@ -1098,6 +1098,7 @@ const en: Translations = { langEn: 'English', currency: 'Currency', currencyHint: 'Display currency. Data is stored in UAH; converted at NBU rate.', + currencyDisabledTooltip: 'Currency conversion is under repair and will be available shortly', currencyUah: 'Hryvnia (UAH)', currencyUsd: 'US Dollar (USD)', currencyEur: 'Euro (EUR)', diff --git a/frontend/src/i18n/uk.ts b/frontend/src/i18n/uk.ts index 7271d77d..bc3f929d 100644 --- a/frontend/src/i18n/uk.ts +++ b/frontend/src/i18n/uk.ts @@ -1095,6 +1095,7 @@ const uk = { langEn: 'English', currency: 'Валюта', currencyHint: 'Валюта відображення. Дані в базі зберігаються в UAH; конвертація за курсом НБУ.', + currencyDisabledTooltip: 'Валютна конвертація в розробці, буде доступна найближчим часом', currencyUah: 'Гривня (UAH)', currencyUsd: 'Долар США (USD)', currencyEur: 'Євро (EUR)', diff --git a/frontend/src/pages/Profile/ProfilePage.tsx b/frontend/src/pages/Profile/ProfilePage.tsx index e4638fb6..2195f08a 100644 --- a/frontend/src/pages/Profile/ProfilePage.tsx +++ b/frontend/src/pages/Profile/ProfilePage.tsx @@ -1,4 +1,4 @@ -import { Card, Descriptions, Button, Space, Tag, Select, message } from 'antd'; +import { Card, Descriptions, Button, Space, Tag, Select, Tooltip, message } from 'antd'; import { GlobalOutlined } from '@ant-design/icons'; import { useEffect } from 'react'; import PageHeader from '../../components/PageHeader'; @@ -112,17 +112,20 @@ export default function ProfilePage() { - - value={preferredCurrency} - onChange={handleCurrencyChange} - style={{ width: 240 }} - options={[ - { value: 'UAH', label: t.profile.currencyUah }, - { value: 'USD', label: t.profile.currencyUsd }, - { value: 'EUR', label: t.profile.currencyEur }, - ]} - /> - {t.profile.currencyHint} + + + value={preferredCurrency} + onChange={handleCurrencyChange} + disabled + style={{ width: 240 }} + options={[ + { value: 'UAH', label: t.profile.currencyUah }, + { value: 'USD', label: t.profile.currencyUsd }, + { value: 'EUR', label: t.profile.currencyEur }, + ]} + /> + + {t.profile.currencyDisabledTooltip} diff --git a/frontend/src/stores/currencyStore.ts b/frontend/src/stores/currencyStore.ts index fddfafcd..b7cf5cb7 100644 --- a/frontend/src/stores/currencyStore.ts +++ b/frontend/src/stores/currencyStore.ts @@ -40,8 +40,14 @@ export const useCurrencyStore = create((set, get) => ({ for (const r of rates as ExchangeRateDto[]) { if (r.code === 'USD' || r.code === 'EUR') next[r.code] = r.rateToUah; } + // HOTFIX (PR #628 follow-up): currency conversion is under repair — force UAH + // display for all users and reset any stale USD/EUR preference server-side so + // that numeric values are not mislabelled. See docs/ROADMAP.md "Currency". + if (prefs.preferredCurrency !== 'UAH') { + try { await updatePreferences('UAH'); } catch { /* ignore — will retry next login */ } + } set({ - preferredCurrency: prefs.preferredCurrency, + preferredCurrency: 'UAH', rates: next, loaded: true, loading: false, @@ -53,10 +59,13 @@ export const useCurrencyStore = create((set, get) => ({ }, setPreferredCurrency: async (c) => { + // HOTFIX: switcher is disabled in UI; always persist UAH. + const forced: SupportedCurrency = 'UAH'; const prev = get().preferredCurrency; - set({ preferredCurrency: c }); + set({ preferredCurrency: forced }); try { - await updatePreferences(c); + await updatePreferences(forced); + void c; } catch (e) { set({ preferredCurrency: prev }); throw e;