-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move the most recent value in sats of an order calculation to the backend #226
Conversation
718a8a8
to
3eeff8c
Compare
api/views.py
Outdated
@@ -268,6 +268,7 @@ def get(self, request, format=None): | |||
data["is_fiat_sent"] = order.is_fiat_sent | |||
data["is_disputed"] = order.is_disputed | |||
data["ur_nick"] = request.user.username | |||
data["satoshis_now"] = Logics.satoshis_now(order) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will add the attribute satoshis_now
to the responses of the endpoint /api/order/
but not to the responses of /api/book/
. It should be instead somewhere around Line 853 for this attribute to be sent once the list of orders is requested in BookView( ) https://github.com/Reckless-Satoshi/robosats/blob/3eeff8c142d11e776b327fe0d9f2495d4acca86a/api/views.py#L848-L857
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, makes sense, I think I went too fast instead of installing the full platform and test the back-end 😞
21193da
to
957227d
Compare
@Reckless-Satoshi Everything should be ready to be tested, I also included the fix for the max range when you use the price |
frontend/src/components/BookPage.js
Outdated
<div style={{ cursor: "pointer" }}>{parseFloat(parseFloat(params.row.premium).toFixed(4))+"%" }</div> | ||
</Tooltip> | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the currency code not being displayed on mobile
|
||
setCenter(medianValue) | ||
setXRange(maxRange) | ||
setRangeSteps(rangeSteps) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the max range not being calculated for other currencies
7560333
to
03f0b3a
Compare
Fixes: #224
The value calculated by
https://github.com/Reckless-Satoshi/robosats/blob/main/frontend/src/components/Charts/DepthChart/index.tsx#L84
Was already being calculated on the back-end, this PR exposes that value so it can be used for the depth chart generation.