Skip to content

Commit

Permalink
feat: entries refresh button and query refresh interval
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Jun 2, 2024
1 parent 9e63e8f commit e720fb0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/renderer/src/components/entry-column/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
} from "@renderer/components/ui/tooltip"
import { views } from "@renderer/lib/constants"
import { buildStorageNS } from "@renderer/lib/ns"
import { cn } from "@renderer/lib/utils"
import { apiClient } from "@renderer/queries/api-fetch"
import { useEntries } from "@renderer/queries/entries"
import { feedActions, useFeedStore } from "@renderer/store"
Expand Down Expand Up @@ -180,6 +181,14 @@ const ListHeader: FC = () => {
</div>
</div>
<div className="flex items-center gap-1">
<Tooltip>
<TooltipTrigger>
<Button className="size-8 rounded-full p-0 text-lg" variant="ghost" onClick={() => entries.refetch()}>
<i className={cn("i-mingcute-refresh-2-line", entries.isRefetching && "animate-spin")} />
</Button>
</TooltipTrigger>
<TooltipContent side="bottom">Refresh</TooltipContent>
</Tooltip>
<Tooltip>
<TooltipTrigger>
<Button className="size-8 rounded-full p-0 text-lg" variant="ghost" onClick={() => setUnreadOnly(!unreadOnly)}>
Expand Down
1 change: 1 addition & 0 deletions src/renderer/src/lib/query-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const queryClient = new QueryClient({
defaultOptions: {
queries: {
gcTime: Infinity,
refetchInterval: 1000 * 60 * 10,
},
},
})
Expand Down

0 comments on commit e720fb0

Please sign in to comment.