Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
Block Explorer UI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
Block Explorer UI
Commits
93162adc
Commit
93162adc
authored
3 months ago
by
Dima Rifai
Browse files
Options
Downloads
Patches
Plain Diff
Get data by latest
parent
37744b77
No related branches found
No related tags found
1 merge request
!507
Delrifai/#394 2 add charts to balance history
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pages/balanceHistory/[accountName].tsx
+3
-3
3 additions, 3 deletions
pages/balanceHistory/[accountName].tsx
with
3 additions
and
3 deletions
pages/balanceHistory/[accountName].tsx
+
3
−
3
View file @
93162adc
...
...
@@ -30,7 +30,7 @@ interface Operation {
const
prepareData
=
(
operations
:
Operation
[])
=>
{
if
(
!
operations
||
operations
.
length
===
0
)
return
[];
const
dailyData
=
new
Map
<
string
,
{
balance
:
number
;
balance_change
:
number
}
>
();
operations
.
forEach
((
operation
:
any
)
=>
{
...
...
@@ -155,14 +155,14 @@ export default function BalanceHistory() {
paramsState
.
coinType
,
undefined
,
5000
,
// Default size for chart data
"
a
sc
"
,
"
de
sc
"
,
effectiveFromBlock
,
effectiveToBlock
);
// Use useMemo to memoize the prepared data so it only recalculates when chartData changes
const
preparedData
=
useMemo
(()
=>
{
return
chartData
?
prepareData
(
chartData
.
operations_result
)
:
[];
return
chartData
?
prepareData
(
chartData
.
operations_result
.
slice
().
reverse
()
)
:
[];
},
[
chartData
]);
// This will only recompute when chartData changes
let
message
=
""
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment