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

Running indicator #1693

Merged
merged 9 commits into from
Jul 16, 2019
Merged

Running indicator #1693

merged 9 commits into from
Jul 16, 2019

Conversation

aaimio
Copy link
Contributor

@aaimio aaimio commented Jul 9, 2019

No description provided.

@coveralls
Copy link

coveralls commented Jul 9, 2019

Coverage Status

Coverage decreased (-0.1%) to 70.216% when pulling 497e92b on aaron-binary:running-indicator into 6d5521d on binary-com:dev.

elStopButtons.forEach(el => {
const elStopButton = el;
elStopButton.style.display = null;
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aaron-binary you copy this code almost 4 times. can it all goes in some "setBotButtonsVisibility` or st like that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each of the blocks does different things, e.g. in one case the block will just be hidden, in another, the block will be hidden and disabled, and in the other, the block is just disabled.

if (error.error && error.error.error.code === 'InvalidToken') {
removeAllTokens();
updateTokenList();
this.stop();
}
});

globalObserver.register('bot.running', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aaron-binary does this globalObserver have something like reaction so it listen to state changes and when ever bot state change to running or not running , disable and enable the buttons once only.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Through the observer you can observer.register('name') to a named event, once that event is emitted (through observer.emit('name')) the callback will be executed. In some cases, the buttons should not be enabled when the bot is not running, e.g. when the user is fetching contracts_for from the API.

@ashkanx ashkanx merged commit 29af92f into binary-com:dev Jul 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
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