diff options
Diffstat (limited to 'ext/mixed/js/api.js')
-rw-r--r-- | ext/mixed/js/api.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/ext/mixed/js/api.js b/ext/mixed/js/api.js index 5c17d50e..1e421147 100644 --- a/ext/mixed/js/api.js +++ b/ext/mixed/js/api.js @@ -212,12 +212,11 @@ const api = (() => { _createActionPort(timeout=5000) { return new Promise((resolve, reject) => { let timer = null; - let portNameResolve; - let portNameReject; - const portNamePromise = new Promise((resolve2, reject2) => { - portNameResolve = resolve2; - portNameReject = reject2; - }); + const { + promise: portNamePromise, + resolve: portNameResolve, + reject: portNameReject + } = deferPromise(); const onConnect = async (port) => { try { |