message: Fix transaction details when showing a state block with previous block being legacy
diff: @@ -48,6 +48,7 @@ export class TransactionDetailsComponent implements OnInit {
  this.fromAccountID = '';
  this.toAddressBook = '';
  this.fromAddressBook = '';
  + let legacyFromAccount = '';
  this.amountRaw = new BigNumber(0);
  const hash = this.route.snapshot.params.transaction;
  this.hashID = hash;
  @@ -69,6 +70,11 @@ export class TransactionDetailsComponent implements OnInit {
  const prevRes = await this.api.blocksInfo([hashData.contents.previous]);
  const prevData = prevRes.blocks[hashData.contents.previous];
  prevData.contents = JSON.parse(prevData.contents);
  + if (!prevData.contents.balance) {
  + // Previous block is not a state block.
  + this.blockType = prevData.contents.type;
  + legacyFromAccount = prevData.source_account;
  + } else {
  const prevBalance = new BigNumber(prevData.contents.balance);
  const curBalance = new BigNumber(hashData.contents.balance);
  const balDifference = curBalance.minus(prevBalance);
  @@ -80,6 +86,7 @@ export class TransactionDetailsComponent implements OnInit {
  this.blockType = 'receive';
  }
  }
  + }
  } else {
  this.isStateBlock = false;
  }
  @@ -106,6 +113,11 @@ export class TransactionDetailsComponent implements OnInit {
  toAccount = this.transaction.contents.representative;
  break;
  }
  +
  + if (legacyFromAccount) {
  + fromAccount = legacyFromAccount;
  + }
  +
  this.toAccountID = toAccount;
  this.fromAccountID = fromAccount;
  