From 1a99b78229a11141679de6174f1a21206e5c77b5 Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Fri, 14 Jan 2022 09:35:27 -0800 Subject: [PATCH] Fix small mistakes --- api/views.py | 16 ++++++------- frontend/src/components/BottomBar.js | 36 +++++++++++++++++++++------- frontend/src/components/OrderPage.js | 2 +- 3 files changed, 37 insertions(+), 17 deletions(-) diff --git a/api/views.py b/api/views.py index 404615da..587a98c4 100644 --- a/api/views.py +++ b/api/views.py @@ -293,14 +293,14 @@ class UserView(APIView): Response with Avatar and Nickname. ''' - if request.user.id: - context = {} - context['nickname'] = request.user.username - participant = not Logics.validate_already_maker_or_taker(request.user) - context['bad_request'] = f'You are already logged in as {request.user}' - if participant: - context['bad_request'] = f'You are already logged in as as {request.user} and have an active order' - return Response(context,status.HTTP_200_OK) + # if request.user.id: + # context = {} + # context['nickname'] = request.user.username + # participant = not Logics.validate_already_maker_or_taker(request.user) + # context['bad_request'] = f'You are already logged in as {request.user}' + # if participant: + # context['bad_request'] = f'You are already logged in as as {request.user} and have an active order' + # return Response(context,status.HTTP_200_OK) token = request.GET.get(self.lookup_url_kwarg) diff --git a/frontend/src/components/BottomBar.js b/frontend/src/components/BottomBar.js index 2d6bf033..eb30284c 100644 --- a/frontend/src/components/BottomBar.js +++ b/frontend/src/components/BottomBar.js @@ -8,17 +8,18 @@ import InventoryIcon from '@mui/icons-material/Inventory'; import SellIcon from '@mui/icons-material/Sell'; import SmartToyIcon from '@mui/icons-material/SmartToy'; import PercentIcon from '@mui/icons-material/Percent'; +import PriceChangeIcon from '@mui/icons-material/PriceChange'; export default class BottomBar extends Component { constructor(props) { super(props); this.state = { - num_public_buy_orders: 0, - num_active_robotsats: 0, - num_public_sell_orders: 0, - fee: 0, - today_avg_nonkyc_btc_premium: 0, - today_volume: 0, + num_public_buy_orders: null, + num_active_robotsats: null, + num_public_sell_orders: null, + fee: null, + today_avg_nonkyc_btc_premium: null, + today_volume: null, }; this.getInfo(); } @@ -40,11 +41,13 @@ export default class BottomBar extends Component { return ( + + @@ -57,6 +60,7 @@ export default class BottomBar extends Component { secondary="Public Buy Orders" /> + @@ -69,6 +73,7 @@ export default class BottomBar extends Component { secondary="Public Sell Orders" /> + @@ -81,10 +86,11 @@ export default class BottomBar extends Component { secondary="Num Active RoboSats" /> + - + - + + + + + + + + + + @@ -111,6 +130,7 @@ export default class BottomBar extends Component { + diff --git a/frontend/src/components/OrderPage.js b/frontend/src/components/OrderPage.js index 30e01a08..c50fd40a 100644 --- a/frontend/src/components/OrderPage.js +++ b/frontend/src/components/OrderPage.js @@ -38,7 +38,7 @@ export default class OrderPage extends Component { super(props); this.state = { isExplicit: false, - delay: 60000, // Refresh every 60 seconds by default + delay: 3000, // Refresh every 3 seconds by default currencies_dict: {"1":"USD"}, total_secs_expiry: 300, loading: true,