diff --git a/server/api/swagger/swagger.js b/server/api/swagger/swagger.js index 474d96dd68..7aa39ffc94 100644 --- a/server/api/swagger/swagger.js +++ b/server/api/swagger/swagger.js @@ -4,7 +4,7 @@ const definition = { swagger: '2.0', info: { title: 'HollaEx Kit', - version: '2.13.0' + version: '2.13.1' }, host: 'api.hollaex.com', basePath: '/v2', diff --git a/server/package.json b/server/package.json index 7d772248cc..c5280c0e23 100644 --- a/server/package.json +++ b/server/package.json @@ -1,5 +1,5 @@ { - "version": "2.13.0", + "version": "2.13.1", "private": false, "description": "HollaEx Kit", "keywords": [ diff --git a/server/utils/hollaex-network-lib/index.js b/server/utils/hollaex-network-lib/index.js index 627b879b28..ff91d3f01d 100644 --- a/server/utils/hollaex-network-lib/index.js +++ b/server/utils/hollaex-network-lib/index.js @@ -1754,7 +1754,7 @@ class HollaExNetwork { data.email = true; } - if (opts.category && ['stake', 'referral', 'internal'].includes(opts.category)) { + if (opts.category) { data.category = opts.category; } diff --git a/server/utils/hollaex-tools-lib/tools/p2p.js b/server/utils/hollaex-tools-lib/tools/p2p.js index 6aff25db5d..5074cda368 100644 --- a/server/utils/hollaex-tools-lib/tools/p2p.js +++ b/server/utils/hollaex-tools-lib/tools/p2p.js @@ -117,7 +117,7 @@ const fetchP2PDeals = async (opts = { } }); } else { - const p2pDeals = await client.getAsync(`p2p-deals${opts.user_id}`); + const p2pDeals = await client.getAsync(`p2p-deals${opts.user_id || 'all'}`); if (p2pDeals) return JSON.parse(p2pDeals); else { @@ -138,7 +138,7 @@ const fetchP2PDeals = async (opts = { } } - await client.setexAsync(`p2p-deals${opts.user_id}`, 30, JSON.stringify(deals)); + await client.setexAsync(`p2p-deals${opts.user_id || 'all'}`, 30, JSON.stringify(deals)); return deals; } @@ -352,6 +352,7 @@ const updateP2PDeal = async (data) => { } }); await client.delAsync(`p2p-deals${merchant_id}`); + await client.delAsync(`p2p-dealsall`); await getModel('p2pDeal').update({ status }, { where : { id : edited_ids }}); return { message : 'success' }; } @@ -410,7 +411,7 @@ const updateP2PDeal = async (data) => { }; await client.delAsync(`p2p-deals${merchant_id}`); - + await client.delAsync(`p2p-dealsall`); return p2pDeal.update(data, { fields: [ 'merchant_id', @@ -446,6 +447,8 @@ const deleteP2PDeal = async (removed_ids, user_id) => { }; await client.delAsync(`p2p-deals${user_id}`); + await client.delAsync(`p2p-dealsall`); + const promises = deals.map(async (deal) => { return await deal.destroy(); }); diff --git a/server/utils/hollaex-tools-lib/tools/user.js b/server/utils/hollaex-tools-lib/tools/user.js index 0bc5a20917..a2c9650b8b 100644 --- a/server/utils/hollaex-tools-lib/tools/user.js +++ b/server/utils/hollaex-tools-lib/tools/user.js @@ -3403,7 +3403,7 @@ const getPaymentDetails = async (user_id, opts = { const query = { where: { created_at: timeframe, - user_id, + ...(user_id && { user_id }), ...(opts.is_p2p && { is_p2p: opts.is_p2p }), ...(opts.is_fiat_control && { is_fiat_control: opts.is_fiat_control }), ...(opts.status && { status: opts.status }) diff --git a/version b/version index fb2c0766b7..94f15e9cc3 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.13.0 +2.13.1 diff --git a/web/package.json b/web/package.json index a70e5ce5fd..e8d2546003 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "hollaex-kit", - "version": "2.13.0", + "version": "2.13.1", "private": true, "dependencies": { "@ant-design/compatible": "1.0.5", diff --git a/web/src/components/AppBar/PairTabs.js b/web/src/components/AppBar/PairTabs.js index ab898047ef..b12ea5ecbb 100644 --- a/web/src/components/AppBar/PairTabs.js +++ b/web/src/components/AppBar/PairTabs.js @@ -1,5 +1,6 @@ import React, { Component } from 'react'; import { connect } from 'react-redux'; +import { bindActionCreators } from 'redux'; import classnames from 'classnames'; import { browserHistory } from 'react-router'; import { Dropdown } from 'antd'; @@ -14,7 +15,10 @@ import withConfig from 'components/ConfigProvider/withConfig'; import { formatToCurrency } from 'utils/currency'; import { MarketsSelector } from 'containers/Trade/utils'; import SparkLine from 'containers/TradeTabs/components/SparkLine'; +import { getSparklines } from 'actions/chartAction'; +import { changeSparkLineChartData } from 'actions/appActions'; +let isMounted = false; class PairTabs extends Component { state = { activePairTab: '', @@ -29,9 +33,6 @@ class PairTabs extends Component { } this.setState({ activePairTab: active }); this.initTabs(pairs, active); - // getSparklines(Object.keys(pairs)).then((chartData) => - // this.props.changeSparkLineChartData(chartData) - // ); } UNSAFE_componentWillReceiveProps(nextProps) { @@ -98,6 +99,7 @@ class PairTabs extends Component { markets, quicktrade, sparkLineChartData, + pairs, } = this.props; const market = markets.find(({ key }) => key === activePairTab) || {}; const { @@ -107,6 +109,13 @@ class PairTabs extends Component { display_name, } = market; + if (activePairTab && !isMounted) { + isMounted = true; + getSparklines(Object.keys(pairs)).then((chartData) => + this.props.changeSparkLineChartData(chartData) + ); + } + const filterQuickTrade = quicktrade.filter(({ type }) => type !== 'pro'); return (