Skip to content

Commit

Permalink
fix nobelium build
Browse files Browse the repository at this point in the history
  • Loading branch information
tangly1024 committed Jul 21, 2023
1 parent 175fc85 commit 7579d9c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions themes/nobelium/components/BlogListScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand Down

0 comments on commit 7579d9c

Please sign in to comment.