File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 1717 onErrorSrc ="assets/images/avatar.png "
1818 [src] ="book.isFromMainstreamPlatform ? book.writer.avatarUrl : 'assets/images/avatar.png' "
1919 />
20- < mat-card-title > {{book.writer.fullName}}</ mat-card-title >
20+ < mat-card-title >
21+ {{book.writer.fullName.length > 0 ? book.writer.fullName : book.writer.name}}
22+ </ mat-card-title >
2123 < mat-card-subtitle >
22- < ion-icon *ngIf ="book.writer.location.length > 0 " name ="location-outline "> </ ion-icon > {{book.writer.location}}
23- @{{book.website.uri}}
24+ < ion-icon *ngIf ="book.writer.location.length > 0 " name ="location-outline "> </ ion-icon >
25+ {{book.writer.location}} @{{book.website.uri}}
2426 </ mat-card-subtitle >
2527 </ mat-card-header >
2628
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ export class WriterService {
6969
7070 _writer . platformId = rawWriterList [ 0 ] [ 'id' ] as number ;
7171 _writer . avatarUrl = rawWriterList [ 0 ] [ 'avatar_url' ] ;
72- _writer . fullName = rawWriterList [ 0 ] [ 'name' ] ;
72+ _writer . fullName = rawWriterList [ 0 ] [ 'name' ] ? rawWriterList [ 0 ] [ 'name' ] : '' ;
7373 _writer . htmlUrl = rawWriterList [ 0 ] [ 'html_url' ] ;
7474 _writer . desc = rawWriterList [ 0 ] [ 'bio' ] ? rawWriterList [ 0 ] [ 'bio' ] : '' ;
7575 }
@@ -81,10 +81,11 @@ export class WriterService {
8181
8282 _writer . platformId = rawWriter [ 'id' ] as number ;
8383 _writer . avatarUrl = rawWriter [ 'avatar_url' ] ;
84- _writer . fullName = rawWriter [ 'name' ] ;
84+ _writer . fullName = rawWriter [ 'name' ] ? rawWriter [ 'name' ] : '' ;
8585 _writer . htmlUrl = rawWriter [ 'html_url' ] ;
8686 _writer . desc = rawWriter [ 'bio' ] ? rawWriter [ 'bio' ] : '' ;
87- if ( / g i t h u b / . test ( newBook . website . uri ) ) _writer . location = rawWriter [ 'location' ] ;
87+ if ( / g i t h u b / . test ( newBook . website . uri ) ) _writer . location = rawWriter [ 'location' ]
88+ ? rawWriter [ 'location' ] : '' ;
8889 }
8990
9091 const query : IQuery = {
You can’t perform that action at this time.
0 commit comments