mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-04 21:15:47 +00:00
Merge pull request #366 from darkdarkdragon/develop-RT-3462
[FIX] emit empty offers list (RT-3462)
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