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

Commit 273b385

Browse files
Merge pull request #8 from binary-com/master
Master
2 parents 8ac4fc9 + 1bc739d commit 273b385

File tree

5 files changed

+21
-24
lines changed

5 files changed

+21
-24
lines changed

src/botPage/bot/Interpreter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ export default class Interpreter {
153153
}
154154
loop() {
155155
if (this.stopped || !this.interpreter.run()) {
156-
this.isErrorTriggered = false;
157156
this.onFinish(this.interpreter.pseudoToNative(this.interpreter.value));
158157
}
159158
}
@@ -173,6 +172,7 @@ export default class Interpreter {
173172
this.$scope.api.disconnect();
174173
}
175174
this.stopped = true;
175+
this.isErrorTriggered = false;
176176

177177
globalObserver.emit('bot.stop');
178178
globalObserver.setState({ isRunning: false });

src/botPage/view/TradeInfoPanel/ClearButton.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default class ClearButton extends React.PureComponent {
1111
componentDidMount() {
1212
globalObserver.register('summary.enable_clear', () => this.setState({ isButtonDisabled: false }));
1313
globalObserver.register('summary.disable_clear', () => this.setState({ isButtonDisabled: true }));
14+
globalObserver.register('bot.running', () => this.setState({ isButtonDisabled: true }));
1415
}
1516
// eslint-disable-next-line class-methods-use-this
1617
confirmClearLog() {

src/botPage/view/TradeInfoPanel/index.js

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ class AnimateTrade extends Component {
4242
};
4343
}
4444
componentWillMount() {
45+
const resetSummary = () => {
46+
resetAnimation();
47+
this.setState({ indicatorMessage: this.indicatorMessages.notRunning });
48+
};
49+
globalObserver.register('reset_animation', resetSummary);
50+
globalObserver.register('summary.clear', resetSummary);
4551
globalObserver.register('bot.running', () => {
4652
$('.stage-tooltip.top:eq(0)').addClass('running');
4753
this.setState({ indicatorMessage: this.indicatorMessages.running });
@@ -50,39 +56,31 @@ class AnimateTrade extends Component {
5056
$('.stage-tooltip.top:eq(0)').removeClass('running');
5157
this.setState({ indicatorMessage: this.indicatorMessages.stopped });
5258
});
53-
globalObserver.register('reset_animation', () => {
54-
resetAnimation();
55-
this.setState({ indicatorMessage: this.indicatorMessages.stopped });
56-
});
57-
5859
$('#stopButton').click(() => {
5960
$('.stage-tooltip.top:eq(0)').removeClass('running');
60-
this.setState({ indicatorMessage: this.state.stopMessage });
61+
this.setState({
62+
indicatorMessage: globalObserver.getState('isRunning')
63+
? this.indicatorMessages.stopping
64+
: this.indicatorMessages.stopped,
65+
});
6166
});
62-
6367
$('#runButton').click(() => {
6468
resetAnimation();
6569
$('.stage-tooltip.top:eq(0)').addClass('running');
66-
this.setState({
67-
indicatorMessage: this.indicatorMessages.starting,
68-
stopMessage : this.indicatorMessages.stopped,
69-
});
70-
globalObserver.register('contract.status', contractStatus => {
71-
this.animateStage(contractStatus);
72-
});
70+
this.setState({ indicatorMessage: this.indicatorMessages.starting });
71+
globalObserver.emit('summary.disable_clear');
72+
globalObserver.register('contract.status', contractStatus => this.animateStage(contractStatus));
7373
});
7474
}
7575
animateStage(contractStatus) {
7676
if (contractStatus.id === 'contract.purchase_sent') {
7777
resetAnimation();
7878
activateStage(0);
79-
8079
this.setState({
8180
buy_price: roundBalance({
8281
balance : contractStatus.proposal.ask_price,
8382
currency: contractStatus.currency,
8483
}),
85-
stopMessage: this.indicatorMessages.stopping,
8684
});
8785
} else if (contractStatus.id === 'contract.purchase_recieved') {
8886
$('.line').addClass('active');
@@ -91,7 +89,7 @@ class AnimateTrade extends Component {
9189
} else if (contractStatus.id === 'contract.sold') {
9290
$('.line').addClass('complete');
9391
activateStage(2);
94-
this.setState({ sell_id: contractStatus.data, stopMessage: this.indicatorMessages.stopped });
92+
this.setState({ sell_id: contractStatus.data });
9593
}
9694

9795
activateStage(contractStatus.id);

src/botPage/view/View.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,6 @@ export default class View {
534534
elStopButton.style.display = 'inline-block';
535535
});
536536

537-
globalObserver.emit('summary.disable_clear');
538537
showSummary();
539538
this.blockly.run(limitations);
540539
};
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
<div class="dbot-banner eu-hide invisible">
22
<div class="dbot-banner__separator"></div>
33
<div class="dbot-banner__icon">
4-
<a href="https://deriv.com/interim/deriv/?utm_source=binary-bot&utm_medium=referral&utm_campaign=deriv-launch" target="_blank">
4+
<a href="https://deriv.com/interim/dbot/?utm_source=binary-bot&utm_medium=referral&utm_campaign=deriv-launch" target="_blank">
55
<img src="./image/d-bot.svg">
6-
</a>
6+
</a>
77
</div>
8-
</a>
98
<div class="dbot-banner__ad">
10-
<a href="https://deriv.com/interim/deriv/?utm_source=binary-bot&utm_medium=referral&utm_campaign=deriv-launch" target="_blank">
9+
<a href="https://deriv.com/interim/dbot/?utm_source=binary-bot&utm_medium=referral&utm_campaign=deriv-launch" target="_blank">
1110
<div class="dbot-banner__ad-text" data-i18n-text="Binary Bot is"></div>
1211
<div class="dbot-banner__ad-text" data-i18n-text="becoming DBot"></div>
1312
</a>
1413
</div>
15-
<a class="dbot-banner__button" href="https://deriv.com/interim/deriv/?utm_source=binary-bot&utm_medium=referral&utm_campaign=deriv-launch" target="_blank" data-i18n-text="Learn more"></a>
14+
<a class="dbot-banner__button" href="https://deriv.com/interim/dbot/?utm_source=binary-bot&utm_medium=referral&utm_campaign=deriv-launch" target="_blank" data-i18n-text="Learn more"></a>
1615
</div>

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