Offer state "undefined". What to do?
See original GitHub issueSo, i’ve created small bot which should accept trades. Scenario is well known.
Some small part of code.
manager.on('newOffer', function(offer) {
/* SOME FUNCTIONS & CHECKS */
// Try to accept the offer
offer.accept(function(err, status) {
console.log('ACCEPTED OFFER STATE: ' + status);
if(status == 'accepted') {
/* DO MYSQL STUFF & MORE */
}
});
});
I check if trade status was accepted and let the server do the stuff. But… Sometimes trade status is “unknown” and trade offer is accepted anyway. No error, just unknown. Will simple if(status != accepted) { return; } skip the acceptation until next check? Or its better just to .decline() the offer?
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Watch Out for Undefined State - Dave Ceddia
This is easy to fix. The simplest way: initialize state with reasonable default values in the constructor. ... This is not the ideal...
Read more >React State giving undefined, new to react - Stack Overflow
I'm new to react-native, I have been working on a simple app but for some reason I keep getting (undefined) for some of...
Read more >React JS UNDEFINED Solution | Reactjs Learning - YouTube
Whenever you fetch data or call an API to display record in React JS components, always make sure data is stored in state....
Read more >Deal with Undefined 'this' in React Event Handlers Correctly
When teaching React to developers, one thing that comes up often is dealing with a common error. In this post, learn how to...
Read more >Cannot Read Property of Undefined in JavaScript - Rollbar
Undefined means that a variable has been declared but has not been assigned a value. In JavaScript, properties and functions can only belong...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Learn to properly code, and best practices and error handling before creating anything around Steams good, stable system 😉
That was just an example, for people like you i will add big fat red notice about that.