File tree Expand file tree Collapse file tree
client/app/profile/components/history Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import {
1717} from '@angular/material/table' ;
1818import { DatePipe } from '@angular/common' ;
1919import { takeUntilDestroyed } from '@angular/core/rxjs-interop' ;
20+ import { of } from 'rxjs' ;
2021
2122@Component ( {
2223 selector : 'app-history' ,
@@ -50,11 +51,17 @@ export class HistoryComponent implements OnInit {
5051 public ngOnInit ( ) : void {
5152 this . viewer = this . route . snapshot . data . viewer ;
5253
53- if ( this . viewer . account ) {
54- const transactionLinesQuery = this . transactionLineService
55- . getForAccount ( this . viewer . account )
56- . pipe ( takeUntilDestroyed ( this . destroyRef ) ) ;
57- this . dataSource = new NaturalDataSource < TransactionLinesQuery [ 'transactionLines' ] > ( transactionLinesQuery ) ;
58- }
54+ const transactionLinesQuery = this . viewer . account
55+ ? this . transactionLineService . getForAccount ( this . viewer . account ) . pipe ( takeUntilDestroyed ( this . destroyRef ) )
56+ : of ( {
57+ __typename : 'TransactionLinePagination' ,
58+ pageSize : 0 ,
59+ pageIndex : 0 ,
60+ length : 0 ,
61+ totalBalance : null ,
62+ items : [ ] ,
63+ } satisfies TransactionLinesQuery [ 'transactionLines' ] ) ;
64+
65+ this . dataSource = new NaturalDataSource < TransactionLinesQuery [ 'transactionLines' ] > ( transactionLinesQuery ) ;
5966 }
6067}
You can’t perform that action at this time.
0 commit comments