Skip to content
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

fix: server side pdf fix #16810

Merged
Merged
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
17 changes: 14 additions & 3 deletions packages/bot-web-ui/src/stores/server-side-bot-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,20 @@ export default class ServerBotStore {
try {
const items = [[localize('Journal')]];
[...this.journal].map(item => {
const arr = [item.msg];
items.push(arr);
let combined_message;

switch (item?.type) {
case JOURNAL_TYPE.WON:
combined_message = `Profit amount: ${item?.amount ?? ''}`;
break;
case JOURNAL_TYPE.LOSS:
combined_message = `Loss amount: ${item?.amount ?? ''}`;
break;
default:
combined_message = `${item?.type ?? ''}:${item?.msg ?? ''}`;
break;
}
items.push([combined_message]);
});
const content = items.map(e => e.join(',')).join('\n');
downloadFile(localize('Journal'), content);
Expand All @@ -388,7 +400,6 @@ export default class ServerBotStore {
console.dir(error);
}
};

handleProposalOpenContract = (poc: ProposalOpenContract) => {
if (poc && !poc?.contract_id && this.active_bot?.bot_id) return;

Expand Down
Loading