From a76d444fe7d3d99fae965fba3be28b9044135b69 Mon Sep 17 00:00:00 2001 From: Sergey Belozyorcev Date: Thu, 28 Dec 2017 03:24:10 +0300 Subject: [PATCH] Fix order of the handlers in AsyncQueue --- src/integrations/utils/AsyncQueue.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/integrations/utils/AsyncQueue.js b/src/integrations/utils/AsyncQueue.js index c16517f..3cd8932 100644 --- a/src/integrations/utils/AsyncQueue.js +++ b/src/integrations/utils/AsyncQueue.js @@ -25,13 +25,13 @@ class AsyncQueue { this.asyncQueue.push = (callback) => { callback(); }; + this._flushed = true; } push(handler) { - if (this.isLoadedDelegate()) { - handler(); - } else { - this.asyncQueue.push(handler); + this.asyncQueue.push(handler); + if (!this._flushed && this.isLoadedDelegate()) { + this.flushQueue(); } } }