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

Sort log info to display the latest trade at the top #3588

Merged
merged 3 commits into from
May 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/botPage/view/LogTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default class LogTable extends Component {
if (!Object.keys(log).length) {
return;
}
this.setState(appendRow(log, this.state));
this.setState(appendRow(log, this.state, true));
}
});
}
Expand Down
24 changes: 16 additions & 8 deletions src/botPage/view/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,23 @@ export const createScope = () => {
return { observer, api, ticksService, symbolApi };
};

export const appendRow = (trade, state) => ({
export const appendRow = (trade, state, isDesc = false) => ({
id : state.id + 1,
rows: [
...state.rows,
{
...trade,
id: state.id + 1,
},
],
rows: isDesc
? [
{
...trade,
id: state.id + 1,
},
...state.rows,
]
: [
...state.rows,
{
...trade,
id: state.id + 1,
},
],
});

export const updateRow = (prevRowIndex, trade, state) => ({
Expand Down
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