smartcert/ts/cert.helpers.ts

18 lines
484 B
TypeScript
Raw Normal View History

2016-07-22 00:11:04 +00:00
import * as plugins from "./cert.plugins";
import * as paths from "./cert.paths";
let firstCall = true;
let accountKeyPresent = true;
export let accountsKeyPresent = () => {
let done = plugins.q.defer();
if (firstCall) {
done.resolve();
firstCall = false;
setTimeout(() => {accountKeyPresent = true},5000);
} else if(accountKeyPresent){
done.resolve()
} else {
setTimeout(done.resolve, 5000);
};
return done.promise;
};