Skip to content
This repository was archived by the owner on May 24, 2021. It is now read-only.

Commit 805ad98

Browse files
authored
Merge pull request #396 from ianadavies/id-fix-confirmations-on-history-update
Set block confirmation on history refresh
2 parents 9e165c1 + ff5a2bf commit 805ad98

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

StratisCore.UI/src/app/shared/services/wallet.service.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,12 @@ export class WalletService extends RestApi {
254254
if (index === -1) {
255255
const mapped = TransactionInfo.mapFromTransactionsHistoryItem(item, this.addressBookService);
256256
newItems.push(mapped);
257+
} else {
258+
if (item.confirmedInBlock && !existingItems[index].transactionConfirmedInBlock) {
259+
existingItems.filter(existing => existing.id === item.id).forEach(existing => {
260+
existing.transactionConfirmedInBlock = item.confirmedInBlock;
261+
});
262+
}
257263
}
258264
});
259265
const set = existingItems.concat(newItems);
@@ -262,8 +268,8 @@ export class WalletService extends RestApi {
262268

263269
public broadcastTransaction(transactionHex: string): Observable<string> {
264270
return this.post('wallet/send-transaction', new TransactionSending(transactionHex)).pipe(
265-
catchError(err => this.handleHttpError(err))
266-
);
271+
catchError(err => this.handleHttpError(err))
272+
);
267273
}
268274

269275
public sendTransaction(transaction: Transaction): Promise<TransactionResponse> {

0 commit comments

Comments
 (0)