pinpad.create should always be async

pull/1/head
ansuz 8 years ago
parent 8de3610532
commit 7a59183bb1

@ -5,13 +5,28 @@ define([
var Nacl = window.nacl; var Nacl = window.nacl;
var create = function (network, proxy, cb) { var create = function (network, proxy, cb) {
if (!network) { return void cb('INVALID_NETWORK'); } if (!network) {
if (!proxy) { return void cb('INVALID_PROXY'); } window.setTimeout(function () {
cb('INVALID_NETWORK');
});
return;
}
if (!proxy) {
window.setTimeout(function () {
cb('INVALID_PROXY');
});
return;
}
var edPrivate = proxy.edPrivate; var edPrivate = proxy.edPrivate;
var edPublic = proxy.edPublic; var edPublic = proxy.edPublic;
if (!(edPrivate && edPublic)) { return void cb('INVALID_KEYS'); } if (!(edPrivate && edPublic)) {
window.setTimeout(function () {
cb('INVALID_KEYS');
});
return;
}
Rpc.create(network, edPrivate, edPublic, function (e, rpc) { Rpc.create(network, edPrivate, edPublic, function (e, rpc) {
if (e) { return void cb(e); } if (e) { return void cb(e); }

Loading…
Cancel
Save