Closed herenickname closed 6 years ago
offers.forEach((offer) => {
if (offer.id in this.pollData) {
if (this.pollData[offer.id] != offer.state) {
this.emit('offerUpdated', offer);
delete this.pollData[offer.id];
}
return;
}
this.pollData[offer.id] = offer.state;
this.emit('newOffer', offer);
});
Should be working now, thanks for the feedback
https://github.com/Jack-Flux/node-opskins-trade/blob/4358b84fc89f1a965463f57bb602cdbc4ddde966/index.js#L38
You can more efficiently use the resources, saving not all the offer, but only its state.
this.pollData[offer.id] = offer.state
===== And on last npm version of module, seems not worked offerUpdated event... After sending offer to user and accepting by him I dont got any new events in offerUpdated