Commit 84c6388a authored by dev0tion's avatar dev0tion

Adjust dashboard and history to new history structure

parent 37c9ccee
......@@ -29,10 +29,11 @@
<tr *ngFor="let transaction of transactions; let i=index">
<!--<td *ngIf="{{ transaction.amount }} < 0">SENT</td>
<td *ngIf="{{ transaction.amount }} > 0">RECEIVED</td>-->
<td *ngIf="i<5">{{ transaction.type }}</td>
<td *ngIf="i<5">{{ transaction.amount | coinNotation | coinAbbreviation }}</td>
<td *ngIf="i<5">{{ transaction.confirmed }}</td>
<td *ngIf="i<5">{{ transaction.id }}</td>
<td *ngIf="i<5">{{ transaction.confirmedInBlock }}</td>
<td *ngIf="i<5">{{ transaction.timestamp * 1000 | date:'medium' }}</td>
<td *ngIf="i<5">{{ transaction.txId }}</td>
</tr>
</table>
<ng-template #noTransactions>Looks like you haven't made any transactions yet</ng-template>
......
......@@ -17,11 +17,9 @@ import { ReceiveComponent } from '../receive/receive.component';
export class DashboardComponent {
constructor(private apiService: ApiService, private globalService: GlobalService, private modalService: NgbModal) {}
private balanceResponse: any;
private confirmedBalance: number;
private unconfirmedBalance: number;
private transactions: any;
private errorMessage: string;
ngOnInit() {
this.getWalletBalance();
......@@ -42,15 +40,15 @@ export class DashboardComponent {
.subscribe(
response => {
if (response.status >= 200 && response.status < 400) {
this.balanceResponse = response.json();
this.confirmedBalance = this.balanceResponse.balances[0].amountConfirmed;
this.unconfirmedBalance = this.balanceResponse.balances[0].amountUnconfirmed;
let balanceResponse = response.json();
this.confirmedBalance = balanceResponse.balances[0].amountConfirmed;
this.unconfirmedBalance = balanceResponse.balances[0].amountUnconfirmed;
}
},
error => {
if (error.status >= 400) {
this.errorMessage = <any>error;
console.log(this.errorMessage);
let errorMessage = <any>error;
console.log(errorMessage);
}
}
);
......@@ -62,15 +60,15 @@ export class DashboardComponent {
.subscribe(
response => {
if (response.status >= 200 && response.status < 400) {
if (response.json().transactions.length > 0) {
this.transactions = response.json().transactions;
if (response.json().transactionsHistory.length > 0) {
this.transactions = response.json().transactionHistory;
}
}
},
error => {
if (error.status >= 400) {
this.errorMessage = <any>error;
console.log(this.errorMessage);
let errorMessage = <any>error;
console.log(errorMessage);
}
}
);
......
......@@ -11,10 +11,11 @@
<tr *ngFor="let transaction of transactions">
<!--<td *ngIf="{{ transaction.amount }} < 0; else received">SENT</td>
<td #received>RECEIVED</td>-->
<td>{{ transaction.timestamp }}</td>
<td>{{ transaction.type }}</td>
<td>{{ transaction.amount | coinNotation | coinAbbreviation }}</td>
<td>{{ transaction.confirmed }}</td>
<td>{{ transaction.txId }}</td>
<td>{{ transaction.id }}</td>
<td>{{ transaction.confirmedInBlock }}</td>
<td>{{ transaction.timestamp * 1000 | date:'medium' }}</td>
</tr>
</table>
</div>
......
......@@ -27,8 +27,8 @@ export class HistoryComponent {
.subscribe(
response => {
if (response.status >= 200 && response.status < 400) {
if (response.json().transactions.length > 0) {
this.transactions = response.json().transactions;
if (response.json().transactionsHistory.length > 0) {
this.transactions = response.json().transactionsHistory;
}
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment