le8i2digy: Keep the posts and show an inline error when a refresh fails
This commit is contained in:
@@ -194,6 +194,11 @@ export function upgradeVideos(current: CardPost[], fresh: CardPost[]): CardPost[
|
||||
return changed ? next : current;
|
||||
}
|
||||
|
||||
/** A failed first-page load: a refresh keeps the posts and flags an inline error; an initial load shows the full error state. */
|
||||
export function firstLoadFailure(refresh: boolean): { fullError: boolean; refreshFailed: boolean } {
|
||||
return { fullError: !refresh, refreshFailed: refresh };
|
||||
}
|
||||
|
||||
/** "1 comment", "0 comments", "2 comments". */
|
||||
export function commentsLabel(count: number): string {
|
||||
return count === 1 ? "1 comment" : `${count} comments`;
|
||||
|
||||
Reference in New Issue
Block a user