Skip to content

Commit

Permalink
Merge pull request #157 from kaloudis/zeus-146
Browse files Browse the repository at this point in the history
ZEUS-146: Create cache for channels names on Channels view
  • Loading branch information
ZeusLN committed Oct 27, 2019
2 parents 460552d + 88f311c commit 4723b6f
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions stores/ChannelsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,16 @@ export default class ChannelsStore {
() => this.channels,
() => {
if (this.channels) {
this.nodes = {};
const nodes: any = {};
this.channels.forEach((channel: Channel) => {
this.getNodeInfo(channel.remote_pubkey).then(
nodeInfo => {
nodes[channel.remote_pubkey] = nodeInfo;
this.nodes = nodes;
}
);
if (!this.nodes[channel.remote_pubkey]) {
this.getNodeInfo(channel.remote_pubkey).then(
nodeInfo => {
this.nodes[
channel.remote_pubkey
] = nodeInfo;
}
);
}
});
}
}
Expand Down

0 comments on commit 4723b6f

Please sign in to comment.