diff --git a/themes/nobelium/components/BlogListScroll.js b/themes/nobelium/components/BlogListScroll.js index 157e80e4..d3d91abb 100644 --- a/themes/nobelium/components/BlogListScroll.js +++ b/themes/nobelium/components/BlogListScroll.js @@ -3,6 +3,7 @@ import { useGlobal } from '@/lib/global' import Link from 'next/link' import React from 'react' import throttle from 'lodash.throttle' +import { deepClone } from '@/lib/utils' export const BlogListScroll = props => { const { posts } = props @@ -11,8 +12,8 @@ export const BlogListScroll = props => { const [page, updatePage] = React.useState(1) let hasMore = false - const postsToShow = posts - ? Object.assign(posts).slice(0, BLOG.POSTS_PER_PAGE * page) + const postsToShow = posts && Array.isArray(posts) + ? deepClone(posts).slice(0, BLOG.POSTS_PER_PAGE * page) : [] if (posts) {