|
|
@@ -345,13 +345,9 @@ class BankClient {
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
yield this.subscribePrivate(address, topic, () => {
|
|
|
// console.log('websocket connected');
|
|
|
- }, (msg) => __awaiter(this, void 0, void 0, function* () {
|
|
|
- console.log('Got new item notification', msg);
|
|
|
+ }, () => __awaiter(this, void 0, void 0, function* () {
|
|
|
yield agentUpdate();
|
|
|
}));
|
|
|
- setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
|
- yield agentUpdate();
|
|
|
- }), 0);
|
|
|
const agentUpdate = () => __awaiter(this, void 0, void 0, function* () {
|
|
|
const agentConfig = (yield storage.get('config')) || {};
|
|
|
const items = yield this.retrievePrivate(address, topic);
|
|
|
@@ -374,6 +370,7 @@ class BankClient {
|
|
|
}
|
|
|
console.log('Finished checking for items');
|
|
|
});
|
|
|
+ yield agentUpdate();
|
|
|
});
|
|
|
}
|
|
|
connectWebsocket(peerAddr, topic, connectCallback, messageCallback) {
|