From 7579d9c6288a443fdbfd0190aa5bdfcd36614375 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Fri, 21 Jul 2023 18:53:49 +0800 Subject: [PATCH] fix nobelium build --- themes/nobelium/components/BlogListScroll.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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) {