Skip to content

Commit 44297bf

Browse files
committed
Fixed exit smart target threshold initialization
1 parent 2375fbf commit 44297bf

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

admin/src/app/botapi.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,7 @@ export class BotApi {
6666
retry(this.RETRIES),
6767
tap(trade => this.log(`fetched trade ${id} info`)),
6868
map(data => {
69-
const trade = new TradeDetails(false, data);
70-
// if (data.entry) {
71-
// trade.entry = new Entry(data.entry); // restore nested class Entry
72-
// }
73-
return trade;
69+
return new TradeDetails(false, data);
7470
}),
7571
catchError(this.handleError('getActiveTradeInfo', null))
7672
);

admin/src/app/trade-details.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ export class ExitInfo {
3737

3838
init?.targets.forEach(x => this.targets.push(new Target(x)));
3939
}
40-
this.threshold = 0.4.toLocaleString() + '%';
40+
if(!init?.threshold){
41+
this.threshold = 0.4.toLocaleString() + '%';
42+
}
4143
}
4244

4345
}

admin/src/app/trade-details/trade-details.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export class TradeDetailsComponent implements OnInit {
7575
}
7676

7777
ngOnInit() {
78-
setTimeout(this.init.bind(this), 0);
78+
this.init()
7979
}
8080

8181
private init() {

0 commit comments

Comments
 (0)