aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js/api.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mixed/js/api.js')
-rw-r--r--ext/mixed/js/api.js28
1 files changed, 0 insertions, 28 deletions
diff --git a/ext/mixed/js/api.js b/ext/mixed/js/api.js
index fa61a1e2..26f4389d 100644
--- a/ext/mixed/js/api.js
+++ b/ext/mixed/js/api.js
@@ -122,30 +122,6 @@ function apiGetDefaultAnkiFieldTemplates() {
}
function _apiInvoke(action, params={}) {
- if (!_isBackendReady) {
- if (_isBackendReadyPromise === null) {
- _isBackendReadyPromise = new Promise((resolve) => (_isBackendReadyResolve = resolve));
- const checkBackendReady = async () => {
- try {
- if (await _apiInvokeRaw('isBackendReady')) {
- _isBackendReady = true;
- _isBackendReadyResolve();
- }
- } catch (e) {
- // NOP
- }
- setTimeout(checkBackendReady, 100); // poll Backend until it responds
- };
- checkBackendReady();
- }
- return _isBackendReadyPromise.then(
- () => _apiInvokeRaw(action, params)
- );
- }
- return _apiInvokeRaw(action, params);
-}
-
-function _apiInvokeRaw(action, params={}) {
const data = {action, params};
return new Promise((resolve, reject) => {
try {
@@ -172,7 +148,3 @@ function _apiInvokeRaw(action, params={}) {
function _apiCheckLastError() {
// NOP
}
-
-let _isBackendReady = false;
-let _isBackendReadyResolve = null;
-let _isBackendReadyPromise = null;