@actual-app/api
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -9,2 +9,3 @@ let ipc = require('node-ipc'); | ||
let replyHandlers = new Map(); | ||
let initialized = null; | ||
@@ -22,8 +23,9 @@ function send(name, args) { | ||
async function init(socketName) { | ||
if (socketClient) { | ||
return; | ||
// Support calling this multiple times before it actually connects | ||
if (initialized) { | ||
return initialized; | ||
} | ||
initialized = getSocket(socketName); | ||
socketClient = await initialized; | ||
socketClient = await getSocket(socketName); | ||
if (!socketClient) { | ||
@@ -70,2 +72,3 @@ // TODO: This could spawn Actual automatically. The ideal solution | ||
socketClient = null; | ||
initialized = false; | ||
} | ||
@@ -72,0 +75,0 @@ |
{ | ||
"name": "@actual-app/api", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "An API for Actual", | ||
@@ -5,0 +5,0 @@ "main": "api.js", |
8371
298