mirror of
https://github.com/Xahau/xahau.js.git
synced 2026-08-23 16:40:52 +00:00
[FIX] emit empty offers list (RT-3462)
For autobridged order books, emit 'model' event, even if offers is empty, to indicate that orderbook is loaded
This commit is contained in:
@@ -255,7 +255,7 @@ OrderBook.prototype.unsubscribe = function() {
|
||||
* @param {Function} callback
|
||||
*/
|
||||
|
||||
OrderBook.prototype.requestOffers = function(callback) {
|
||||
OrderBook.prototype.requestOffers = function(callback=function() {}) {
|
||||
const self = this;
|
||||
|
||||
if (!this._shouldSubscribe) {
|
||||
@@ -1207,6 +1207,8 @@ OrderBook.prototype.mergeDirectAndAutobridgedBooks = function() {
|
||||
const self = this;
|
||||
|
||||
if (_.isEmpty(this._offers) && _.isEmpty(this._offersAutobridged)) {
|
||||
// still emit empty offers list to indicate that load is completed
|
||||
this.emit('model', []);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user