Skip to content

Commit d52db8b

Browse files
committed
Add the UK warning
1 parent 16c29ed commit d52db8b

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- added: Warning message about risks of investing to all UK IPs
6+
57
## 4.13.0
68

79
- added: Cardano staking through Kiln staking pools

src/actions/LoginActions.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { readSyncedSettings } from '../actions/SettingsActions'
1010
import { ConfirmContinueModal } from '../components/modals/ConfirmContinueModal'
1111
import { FioCreateHandleModal } from '../components/modals/FioCreateHandleModal'
1212
import { SurveyModal } from '../components/modals/SurveyModal'
13-
import { Airship, showError } from '../components/services/AirshipInstance'
13+
import { Airship, showError, showPersistentWarning } from '../components/services/AirshipInstance'
1414
import { ENV } from '../env'
1515
import { getExperimentConfig } from '../experimentConfig'
1616
import { lstrings } from '../locales/strings'
@@ -22,8 +22,8 @@ import { NavigationBase, NavigationProp } from '../types/routerTypes'
2222
import { currencyCodesToEdgeAssets } from '../util/CurrencyInfoHelpers'
2323
import { logActivity } from '../util/logger'
2424
import { logEvent, trackError } from '../util/tracking'
25-
import { runWithTimeout } from '../util/utils'
26-
import { loadAccountReferral, refreshAccountReferral } from './AccountReferralActions'
25+
import { openLink, runWithTimeout } from '../util/utils'
26+
import { getCountryCodeByIp, loadAccountReferral, refreshAccountReferral } from './AccountReferralActions'
2727
import { getUniqueWalletName } from './CreateWalletActions'
2828
import { getDeviceSettings, writeIsSurveyDiscoverShown } from './DeviceSettingsActions'
2929
import { readLocalAccountSettings } from './LocalSettingsActions'
@@ -249,13 +249,22 @@ export function initializeAccount(navigation: NavigationBase, account: EdgeAccou
249249
showError(error)
250250
}
251251

252+
// Post login stuff:
252253
if (!newAccount && !hideSurvey && !getDeviceSettings().isSurveyDiscoverShown && config.disableSurveyModal !== true) {
253254
// Show the survey modal once per app install, only if this isn't the
254255
// first login of a newly created account and the user didn't get any
255256
// other modals or scene changes immediately after login.
256257
await Airship.show(bridge => <SurveyModal bridge={bridge} />)
257258
await writeIsSurveyDiscoverShown(true)
258259
}
260+
261+
if ((await getCountryCodeByIp()) === 'GB') {
262+
await showPersistentWarning(lstrings.warning_uk_risk, {
263+
onPress: async () => {
264+
await openLink('https://edge.app/due-diligence/')
265+
}
266+
})
267+
}
259268
}
260269
}
261270

src/locales/en_US.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ const strings = {
127127
warning_token_contract_override_3s:
128128
'The entered token %1$s exists as a built-in token %2$s with the same contract address. Please proceed with caution and verify the contract is legitimate as use of this token can result in loss of funds. If you have questions about this feature please contact %3$s.',
129129
warning_token_exists_1s: 'The entered token already exists as a built-in token %1$s',
130+
warning_uk_risk: `Don't invest unless you're prepared to lose all the money you invest. This is a high-risk investment and you should not expect to be protected if something goes wrong. Take 2 min to learn more.`,
130131

131132
// Alert component:
132133
alert_dropdown_alert: 'Alert! ',

src/locales/strings/enUS.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
"warning_token_code_override_2s": "The entered contract address differs from the contract address of built-in token %1$s. Please proceed with caution and verify the contract is legitimate as use of this token can result in loss of funds. If you have questions about this feature or contract please contact %2$s.",
8282
"warning_token_contract_override_3s": "The entered token %1$s exists as a built-in token %2$s with the same contract address. Please proceed with caution and verify the contract is legitimate as use of this token can result in loss of funds. If you have questions about this feature please contact %3$s.",
8383
"warning_token_exists_1s": "The entered token already exists as a built-in token %1$s",
84+
"warning_uk_risk": "Don't invest unless you're prepared to lose all the money you invest. This is a high-risk investment and you should not expect to be protected if something goes wrong. Take 2 min to learn more.",
8485
"alert_dropdown_alert": "Alert! ",
8586
"alert_dropdown_warning": "Warning! ",
8687
"azteco_success": "You've redeemed an Azteco bitcoin card. Funds should arrive shortly.",

0 commit comments

Comments
 (0)