Skip to content

Commit

Permalink
change text on fallback message when api data not available
Browse files Browse the repository at this point in the history
  • Loading branch information
posthello-code committed Jul 12, 2024
1 parent 6dd0e82 commit 8f1439f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/app/timeline-viewer/timeline-viewer.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
</ng-template>
</p-scrollPanel>
</div>
<ng-template #elseDataFallback>
API temporarily unavailable.
<ng-template [style]="{ display: 'flex' }" #elseDataFallback>
<div>Thanks for visiting, take a deep breath and try again in a moment.</div>
<button (click)="reload()">Click here to reload</button>
</ng-template>
7 changes: 2 additions & 5 deletions src/app/timeline-viewer/timeline-viewer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,13 @@ export class TimelineViewerComponent {
commentsAvailable: boolean;
comments: Comment[];
isSmallScreen: boolean | undefined;
isLoading: boolean;
constructor(private slackerNewsApi: SlackerNewsApiService) {
this.isLoading = true;
this.stories = [];
this.comments = [];
this.dataAvailable = false;
this.commentsAvailable = false;
}

ngOnInit() {
this.reload();
}

Expand All @@ -72,7 +71,6 @@ export class TimelineViewerComponent {
})
.catch((e) => {
this.dataAvailable = false;
console.log("catch");
console.log(e);
});
this.slackerNewsApi
Expand All @@ -85,7 +83,6 @@ export class TimelineViewerComponent {
})
.catch((e) => {
this.commentsAvailable = false;
console.log("catch");
console.log(e);
});
}
Expand Down

0 comments on commit 8f1439f

Please sign in to comment.