Skip to content

Commit 5556296

Browse files
committed
fixes #794 Shouldn't be able to set trading to active if you page is not set to public
1 parent 58bbabc commit 5556296

File tree

8 files changed

+25
-1
lines changed

8 files changed

+25
-1
lines changed

frontend/public/locales/de-DE/trade-matches.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"viewTradePartner": "View matches",
4848
"noTradePartners": "We couldn't find anyone for you to trade with.",
4949
"isActiveTrading": "Accepting new trades",
50+
"isActiveTradingDisabledTooltip": "Du musst dein Profil öffentlich machen, bevor du den aktiven Tausch aktivieren kannst.",
5051
"toCollectTooltip": "The amount of cards you want to collect by trading. Tip: Set this value to 0 to exclude a rarity from trading.",
5152
"toKeepTooltip": "The minimum amount of cards you want to trade down to.",
5253
"tabMatches": "Matches",

frontend/public/locales/en-US/trade-matches.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"noPossibleTradesDescription": "No trades between you and your friend are currently possible.",
1717
"featureDescription": "This dialog will show you the possible trades between your cards and that of the selected friend ID. It shows you duplicate cards that the other party doesn't own yet.",
1818
"isActiveTrading": "Accepting new trades",
19+
"isActiveTradingDisabledTooltip": "You must make your profile public before enabling active trading.",
1920
"inActiveTradePage": "The user \"{{username}}\" is currently not accepting any trades.",
2021
"inActiveTradeDescription": "Their trading page is set to disabled. Please contact them if you want to trade.",
2122
"toCollectTooltip": "The amount of cards you want to collect by trading. Tip: Set this value to 0 to exclude a rarity from trading.",

frontend/public/locales/es-ES/trade-matches.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"noAccount": "First set up your account using 'Edit profile' in the top right corner.",
5454
"longOperation": "This might take a while.",
5555
"isActiveTrading": "Accepting new trades",
56+
"isActiveTradingDisabledTooltip": "Debes hacer público tu perfil antes de habilitar el intercambio activo.",
5657
"toCollectTooltip": "The amount of cards you want to collect by trading. Tip: Set this value to 0 to exclude a rarity from trading.",
5758
"toKeepTooltip": "The minimum amount of cards you want to trade down to.",
5859
"search": {

frontend/public/locales/fr-FR/trade-matches.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"noPossibleTrades": "Aucun échange possible.",
1616
"noPossibleTradesDescription": "Aucun échange entre vous et votre ami(e) n'est actuellement possible.",
1717
"featureDescription": "Cette boîte de dialogue affiche les échanges possibles entre vos cartes et celles de l'ID de l'ami(e) sélectionné(e). Elle montre les cartes en double que l'autre personne ne possède pas encore.",
18+
"isActiveTradingDisabledTooltip": "Vous devez rendre votre profil public avant d'activer les échanges.",
1819
"inActiveTradePage": "L'utilisateur « {{username}} » n'accepte actuellement aucun échange.",
1920
"inActiveTradeDescription": "Leur page d'échanges est désactivée. Veuillez les contacter si vous souhaitez faire un échange.",
2021
"accountSaved": "Compte enregistré.",

frontend/public/locales/it-IT/trade-matches.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"noAccount": "First set up your account using 'Edit profile' in the top right corner.",
5656
"longOperation": "This might take a while.",
5757
"isActiveTrading": "Accepting new trades",
58+
"isActiveTradingDisabledTooltip": "Devi rendere pubblico il tuo profilo prima di abilitare lo scambio attivo.",
5859
"toCollectTooltip": "The amount of cards you want to collect by trading. Tip: Set this value to 0 to exclude a rarity from trading.",
5960
"toKeepTooltip": "The minimum amount of cards you want to trade down to.",
6061
"search": {

frontend/public/locales/pt-BR/trade-matches.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"toKeep": "To keep",
5252
"longOperation": "This might take a while.",
5353
"isActiveTrading": "Accepting new trades",
54+
"isActiveTradingDisabledTooltip": "Você deve tornar seu perfil público antes de ativar a troca ativa.",
5455
"toCollectTooltip": "The amount of cards you want to collect by trading. Tip: Set this value to 0 to exclude a rarity from trading.",
5556
"toKeepTooltip": "The minimum amount of cards you want to trade down to.",
5657
"search": {

frontend/src/components/EditProfile.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const EditProfile: FC = () => {
4848
username: values.username,
4949
friend_id: values.friend_id,
5050
is_public: values.is_public,
51+
is_active_trading: values.is_public === false ? false : account?.is_active_trading,
5152
} as AccountRow,
5253
{
5354
onSuccess: () => toast({ title: t('accountSaved'), variant: 'default' }),

frontend/src/pages/trade/TradeSettings.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,24 @@ function TradeSettings() {
7474
<FormControl>
7575
<FormLabel className="flex">
7676
{t('isActiveTrading')}
77-
<Switch className="ml-2" checked={field.value} onCheckedChange={field.onChange} />
77+
<Switch
78+
className="ml-2"
79+
checked={field.value}
80+
onCheckedChange={field.onChange}
81+
disabled={!account?.is_public}
82+
data-tooltip-id="is-active-trading-disabled"
83+
data-tooltip-content={!account?.is_public ? t('isActiveTradingDisabledTooltip') : undefined}
84+
/>
85+
{!account?.is_public && (
86+
<>
87+
<Tooltip id="is-active-trading-disabled" />
88+
<CircleHelp
89+
className="size-4 ml-1"
90+
data-tooltip-id="is-active-trading-disabled"
91+
data-tooltip-content={t('isActiveTradingDisabledTooltip')}
92+
/>
93+
</>
94+
)}
7895
</FormLabel>
7996
</FormControl>
8097
</FormItem>

0 commit comments

Comments
 (0)