This commit is contained in:
root 2019-08-29 13:10:17 +05:30
parent a9a80cb119
commit c6b3646834

View File

@ -71,24 +71,22 @@ export class LatestblocksComponent implements OnInit {
//console.log(this.blockdetails); //console.log(this.blockdetails);
if (this.CurrentpageNumber == 1) { 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 onlyInA = this.FirstPageListData.filter(this.comparer(this.Merged_data));
// var socket_array = this.blockdetails.BlockchainBlockResult; var onlyInB = this.Merged_data.filter(this.comparer(this.FirstPageListData));
// 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)); this.DifferentList = onlyInA.concat(onlyInB);
// var onlyInB = this.Merged_data.filter(this.comparer(this.FirstPageListData));
// 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; this.lastblock = this.blockdetails.block_height;
@ -104,6 +102,7 @@ export class LatestblocksComponent implements OnInit {
} }
public createBlock(DifferentList) { public createBlock(DifferentList) {
this.FirstPageListData.push(DifferentList);
const blockFactory = this.resolver.resolveComponentFactory( const blockFactory = this.resolver.resolveComponentFactory(
BlockAppendComponent, BlockAppendComponent,
); );