From 8c1ebe6bcbc3511231c60133cd54722ae97e43ee Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Fri, 6 May 2016 21:42:15 -0700 Subject: [PATCH] WIP --- ext/bg/js/yomichan.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ext/bg/js/yomichan.js b/ext/bg/js/yomichan.js index 4a9fd35c..f1cda178 100644 --- a/ext/bg/js/yomichan.js +++ b/ext/bg/js/yomichan.js @@ -103,10 +103,11 @@ class Yomichan { } ankiInvoke(action, params, pool, callback) { - if (pool !== null && this.asyncPools.hasOwnProperty(pool)) { - this.asyncPools[pool].abort(); - callback(null); - } else if (this.options.enableAnkiConnect) { + if (this.options.enableAnkiConnect) { + if (pool !== null && this.asyncPools.hasOwnProperty(pool)) { + this.asyncPools[pool].abort(); + } + const xhr = new XMLHttpRequest(); xhr.addEventListener('loadend', () => { if (pool !== null) {