Skip to content

Commit

Permalink
Merge pull request #117 from NazarUsov/testnet/issues
Browse files Browse the repository at this point in the history
Fix view for transaction
  • Loading branch information
sowle authored May 16, 2024
2 parents 996579f + 92b0b09 commit 007aeef
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
23 changes: 21 additions & 2 deletions html_source/src/app/pages/wallet/tabs/history/history.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, NgZone, OnDestroy, OnInit } from '@angular/core';
import { VariablesService } from '@parts/services/variables.service';
import { ActivatedRoute } from '@angular/router';
import { Subtransfer, Transaction } from '@api/models/transaction.model';
import { Subtransfer, Subtransfers, Transaction } from '@api/models/transaction.model';
import BigNumber from 'bignumber.js';
import { PaginationService } from '@store/pagination/pagination.service';
import { PaginationStore } from '@store/pagination/pagination.store';
Expand Down Expand Up @@ -169,6 +169,17 @@ import { zanoAssetInfo } from '@parts/data/assets';
</ng-container>
</ng-container>
<ng-container *ngIf="isInitiator(transaction) && !hasZano(transaction.subtransfers)">
<div [ngClass]="'received'" class="status text-ellipsis" fxLayout="row"
fxLayoutAlign=" center">
<img alt="" class="status-transaction mr-1"
src="assets/icons/aqua/receive.svg" />
<span
class="status-transaction-text">{{ 'HISTORY.RECEIVED' | translate }}</span>
</div>
</ng-container>
<ng-template #noSubtransfersStatusTemplate>
<div [ngClass]="'received'" class="status text-ellipsis" fxLayout="row"
fxLayoutAlign=" center">
Expand Down Expand Up @@ -200,7 +211,7 @@ import { zanoAssetInfo } from '@parts/data/assets';
*ngIf="isFinalizator(transaction)">{{ subtransfer.amount.negated() | intToMoney }}</ng-container>
</span>
<span *ngIf="subtransfer.is_income">
{{ subtransfer.amount | intToMoney }}
{{ (isInitiator(transaction) ? subtransfer.amount.plus(transaction.fee) : subtransfer.amount) | intToMoney }}
</span>
{{ (subtransfer.asset_id | getAssetInfo)?.ticker || '???' }}
</div>
Expand All @@ -220,6 +231,10 @@ import { zanoAssetInfo } from '@parts/data/assets';
</ng-container>
</ng-container>
</ng-container>
<ng-container *ngIf="isInitiator(transaction) && !hasZano(transaction.subtransfers)">
{{ transaction.fee | intToMoney }} {{ variablesService.defaultCurrency }}
</ng-container>
</ng-container>
<ng-template #noSubtransfersAmountTemplate>
Expand Down Expand Up @@ -589,6 +604,10 @@ export class HistoryComponent implements OnInit, OnDestroy {
});
}

hasZano(subtransfers: Subtransfers): boolean {
return Boolean(subtransfers.find(({ asset_id }) => asset_id === zanoAssetInfo.asset_id));
}

setPage(pageNumber: number): void {
// this is will allow pagination for wallets that was open from existed wallets'
if (pageNumber === this.variablesService.currentWallet.currentPage) {
Expand Down
4 changes: 3 additions & 1 deletion html_source/src/app/pages/wallet/wallet/wallet.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ const objTabs: { [key in TabNameKeys]: Tab } = {
</div>
</div>
</div>
<ng-container *ngIf="variablesService.currentWallet.has_bare_unspent_outputs">
<ng-container *ngIf="!variablesService.currentWallet.is_auditable && !variablesService.currentWallet.is_watch_only">
<ng-container *ngIf="variablesService.currentWallet.has_bare_unspent_outputs">
<hr fxFlex="0 0 1px" style="height: 3.6rem; border: none; border-right: 1px solid #ffffff10">
<div class="migrate-alert" fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="2rem">
<button class="btn-migrate" type="button" (click)="openMigrateWalletToZarcanum()">{{ 'WALLET.MIGRATE.BUTTON2' | translate }}</button>
Expand All @@ -200,6 +201,7 @@ const objTabs: { [key in TabNameKeys]: Tab } = {
</div>
</div>
</ng-container>
</ng-container>
</div>
<div class="right">
<div class="dropdown">
Expand Down

0 comments on commit 007aeef

Please sign in to comment.