Skip to content

Commit

Permalink
feat: feed error tips
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed May 15, 2024
1 parent f82f695 commit 92eefce
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
34 changes: 30 additions & 4 deletions src/renderer/src/components/feed-column/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
TooltipTrigger,
} from "@renderer/components/ui/tooltip"
import { FeedIcon } from "@renderer/components/feed-icon"
import dayjs from "@renderer/lib/dayjs"

export function FeedList({
className,
Expand Down Expand Up @@ -175,18 +176,43 @@ function FeedCategory({
setFeedActive(feed)
}}
>
<div className="flex items-center min-w-0">
<div
className={cn(
"flex items-center min-w-0",
feed.feeds.errorAt && "text-red-900",
)}
>
<FeedIcon feed={feed.feeds} className="w-4 h-4" />
<div className="truncate">{feed.feeds.title}</div>
{feed.feeds.errorAt && (
<TooltipProvider delayDuration={300}>
<Tooltip>
<TooltipTrigger asChild>
<i className="i-mingcute-wifi-off-line shrink-0 ml-1 text-base" />
</TooltipTrigger>
<TooltipContent>
Error since{" "}
{dayjs
.duration(
dayjs(feed.feeds.errorAt).diff(
dayjs(),
"minute",
),
"minute",
)
.humanize(true)}
</TooltipContent>
</Tooltip>
</TooltipProvider>
)}
{feed.isPrivate && (
<TooltipProvider delayDuration={300}>
<Tooltip>
<TooltipTrigger asChild>
<i className="i-mingcute-eye-close-line shrink-0 ml-0.5" />
<i className="i-mingcute-eye-close-line shrink-0 ml-1 text-base" />
</TooltipTrigger>
<TooltipContent>
This feed will not be publicly displayed on your
profile page.
Not publicly visible on your profile page
</TooltipContent>
</Tooltip>
</TooltipProvider>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/follow/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export function FollowDialog({
<div>
<FormLabel>Prviate Follow</FormLabel>
<FormDescription>
Whether to publicly display your follow on your profile
Whether this follow is publicly visible on your profile
page.
</FormDescription>
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export type FeedResponse = {
lastModifiedHeader?: string
etagHeader?: string
ttl: number
errorAt?: string
errorMessage?: string
}

export type SubscriptionResponse = {
Expand Down

0 comments on commit 92eefce

Please sign in to comment.