diff options
| author | Adam Soltys <[email protected]> | 2020-02-08 17:55:29 -0500 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-02-08 17:55:29 -0500 |
| commit | 2aec283f939759f0a3812377f5f939a3b197bfdf (patch) | |
| tree | 941cbd1f5dec6e9d5537503fa8a37350a4fbb722 | |
| parent | 3303c4e0e08d778a80a8592bf1339acdc0ca3b0a (diff) | |
| download | coinos-server-2aec283f939759f0a3812377f5f939a3b197bfdf.tar.gz coinos-server-2aec283f939759f0a3812377f5f939a3b197bfdf.zip | |
default usd
| -rw-r--r-- | users.js | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -78,8 +78,10 @@ module.exports = (addresses, auth, app, bc, db, emit) => { if (ip === "127.0.0.1") user.currency = "CAD"; - else - user.currency = countries[(await axios.get(`http://api.ipstack.com/${ip}?access_key=${config.ipstack}`)).data.country_code] || "EUR"; + else { + let info = await axios.get(`http://api.ipstack.com/${ip}?access_key=${config.ipstack}`); + user.currency = countries[info.data.country_code] || "USD"; + } user.currencies = [user.currency]; |
