Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit 7c75c6e

Browse files
authored
Merge pull request #3588 from farabi-deriv/fix--logtable-order
Farabi / Sort log info to display the latest trade at the top
2 parents 7d474c7 + 549a3a1 commit 7c75c6e

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

src/botPage/view/LogTable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default class LogTable extends Component {
5353
if (!Object.keys(log).length) {
5454
return;
5555
}
56-
this.setState(appendRow(log, this.state));
56+
this.setState(appendRow(log, this.state, true));
5757
}
5858
});
5959
}

src/botPage/view/shared.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,23 @@ export const createScope = () => {
2525
return { observer, api, ticksService, symbolApi };
2626
};
2727

28-
export const appendRow = (trade, state) => ({
28+
export const appendRow = (trade, state, isDesc = false) => ({
2929
id : state.id + 1,
30-
rows: [
31-
...state.rows,
32-
{
33-
...trade,
34-
id: state.id + 1,
35-
},
36-
],
30+
rows: isDesc
31+
? [
32+
{
33+
...trade,
34+
id: state.id + 1,
35+
},
36+
...state.rows,
37+
]
38+
: [
39+
...state.rows,
40+
{
41+
...trade,
42+
id: state.id + 1,
43+
},
44+
],
3745
});
3846

3947
export const updateRow = (prevRowIndex, trade, state) => ({

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy