Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: disable refreshInterval #284

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/common/components/skeleton/BlogCardNewSkeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import SkeletonLoader from '../elements/SkeletonLoader';
const BlogCardNewSkeleton = () => {
return (
<SkeletonLoader>
<Card className='border border-neutral-200 dark:border-neutral-800 min-w-[326px] dark:bg-neutral-800'>
<Card className='min-w-[326px] !bg-neutral-800'>
<Skeleton
height={398}
containerClassName='flex'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import SkeletonLoader from '../elements/SkeletonLoader';
const BlogFeaturedHeroSkeleton = () => {
return (
<SkeletonLoader>
<Card className='border border-neutral-200 dark:border-neutral-800 min-w-[326px] dark:bg-neutral-800'>
<Card className='min-w-[326px] !bg-neutral-800'>
<Skeleton
height={400}
containerClassName='flex'
Expand Down
2 changes: 1 addition & 1 deletion src/common/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ a {

#nprogress .bar {
background: #15b8a6 !important;
height: 1px !important;
height: 2px !important;
z-index: 9999999 !important;
}

Expand Down
6 changes: 5 additions & 1 deletion src/modules/blog/components/BlogFeaturedSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import BlogFeaturedHero from './BlogFeaturedHero';
const BlogFeaturedSection = () => {
const { data, isLoading } = useSWR(
`/api/blog?page=1&per_page=4&categories=11`,
fetcher
fetcher,
{
revalidateOnFocus: false,
refreshInterval: 0,
}
);

const featuredData: BlogItemProps[] = useMemo(() => {
Expand Down
1 change: 1 addition & 0 deletions src/modules/blog/components/BlogListNew.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const BlogListNew = () => {
fetcher,
{
revalidateOnFocus: false,
refreshInterval: 0,
}
);

Expand Down
5 changes: 4 additions & 1 deletion src/modules/home/components/BlogCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import BlogCardNew from '@/modules/blog/components/BlogCardNew';
import { fetcher } from '@/services/fetcher';

const BlogCarousel = () => {
const { data, isLoading } = useSWR(`/api/blog?page=1&per_page=4`, fetcher);
const { data, isLoading } = useSWR(`/api/blog?page=1&per_page=4`, fetcher, {
revalidateOnFocus: false,
refreshInterval: 0,
});

const blogData: BlogItemProps[] = useMemo(() => {
return data?.data?.posts || [];
Expand Down