Fixed on more homepage error
This commit is contained in:
parent
1a51c580d4
commit
48f6059bbd
@ -33,12 +33,12 @@ function fallbackGenerateStories(announcements: UseFetchReturn<Announcement[]>)
|
||||
return fallbackStory(announcements.error, true)
|
||||
}
|
||||
|
||||
const stories = generateStories(announcements.data, announcements.refetch)
|
||||
|
||||
if (stories.length === 0) {
|
||||
if (announcements.data.length === 0) {
|
||||
return [{ url: '/static/empty.png' }]
|
||||
}
|
||||
|
||||
const stories = generateStories(announcements.data, announcements.refetch)
|
||||
|
||||
return stories
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ function HomePage() {
|
||||
/>
|
||||
<div style={styles.container}>
|
||||
<Stories
|
||||
currentIndex={index.n}
|
||||
currentIndex={index.n % stories.length}
|
||||
onStoryEnd={index.increment}
|
||||
onNext={index.increment}
|
||||
onPrevious={index.decrement}
|
||||
|
Loading…
x
Reference in New Issue
Block a user