From c6b364683488dea10a4628f1017706c230f85cff Mon Sep 17 00:00:00 2001 From: root Date: Thu, 29 Aug 2019 13:10:17 +0530 Subject: [PATCH] updated --- .../latestblocks/latestblocks.component.ts | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/app/view/home/latestblocks/latestblocks.component.ts b/src/app/view/home/latestblocks/latestblocks.component.ts index 86950e6..7722271 100644 --- a/src/app/view/home/latestblocks/latestblocks.component.ts +++ b/src/app/view/home/latestblocks/latestblocks.component.ts @@ -71,24 +71,22 @@ export class LatestblocksComponent implements OnInit { //console.log(this.blockdetails); if (this.CurrentpageNumber == 1) { + var socket_array = this.blockdetails.BlockchainBlockResult; + var ids = new Set(socket_array.map(d => d.blockchain_block_height)); + this.Merged_data = [...socket_array, ...this.FirstPageListData.filter(d => !ids.has(d.blockchain_block_height))]; - - // var socket_array = this.blockdetails.BlockchainBlockResult; - // var ids = new Set(socket_array.map(d => d.blockchain_block_height)); - // this.Merged_data = [...socket_array, ...this.FirstPageListData.filter(d => !ids.has(d.blockchain_block_height))]; + var onlyInA = this.FirstPageListData.filter(this.comparer(this.Merged_data)); + var onlyInB = this.Merged_data.filter(this.comparer(this.FirstPageListData)); - // var onlyInA = this.FirstPageListData.filter(this.comparer(this.Merged_data)); - // var onlyInB = this.Merged_data.filter(this.comparer(this.FirstPageListData)); - - // this.DifferentList = onlyInA.concat(onlyInB); + this.DifferentList = onlyInA.concat(onlyInB); - // this.DifferentList.sort((a, b) => (a.blockchain_block_height) - (b.blockchain_block_height)); + this.DifferentList.sort((a, b) => (a.blockchain_block_height) - (b.blockchain_block_height)); + + this.DifferentList.forEach(DifferentList_dub => { + this.createBlock(DifferentList_dub); + }); - // this.DifferentList.forEach(DifferentList => { - // this.FirstPageListData.unshift(DifferentList); - // //this.createBlock(DifferentList) - // }); } this.lastblock = this.blockdetails.block_height; @@ -104,6 +102,7 @@ export class LatestblocksComponent implements OnInit { } public createBlock(DifferentList) { + this.FirstPageListData.push(DifferentList); const blockFactory = this.resolver.resolveComponentFactory( BlockAppendComponent, );