published-filter-fix
This commit is contained in:
parent
76a15c8aa9
commit
7bc743d8a7
|
@ -55,7 +55,7 @@ export const HomeView = (props: Props) => {
|
|||
loadTopMonthArticles()
|
||||
if (sortedArticles().length < PRERENDERED_ARTICLES_COUNT + CLIENT_LOAD_ARTICLES_COUNT) {
|
||||
const { hasMore } = await loadShouts({
|
||||
filters: { visibility: 'public' },
|
||||
filters: { published: true },
|
||||
limit: CLIENT_LOAD_ARTICLES_COUNT,
|
||||
offset: sortedArticles().length,
|
||||
})
|
||||
|
@ -84,7 +84,7 @@ export const HomeView = (props: Props) => {
|
|||
saveScrollPosition()
|
||||
|
||||
const { hasMore } = await loadShouts({
|
||||
filters: { visibility: 'public' },
|
||||
filters: { published: true },
|
||||
limit: LOAD_MORE_PAGE_SIZE,
|
||||
offset: sortedArticles().length,
|
||||
})
|
||||
|
|
|
@ -6,7 +6,7 @@ import { apiClient } from '../graphql/client/core'
|
|||
|
||||
export const onBeforeRender = async (_pageContext: PageContext) => {
|
||||
const options = {
|
||||
filters: { visibility: 'public' },
|
||||
filters: { published: true },
|
||||
limit: PRERENDERED_ARTICLES_COUNT,
|
||||
}
|
||||
const homeShouts = await apiClient.getShouts({ options })
|
||||
|
|
|
@ -20,7 +20,7 @@ export const HomePage = (props: PageProps) => {
|
|||
}
|
||||
|
||||
await Promise.all([
|
||||
loadShouts({ filters: { visibility: 'public' }, limit: PRERENDERED_ARTICLES_COUNT }),
|
||||
loadShouts({ filters: { published: true }, limit: PRERENDERED_ARTICLES_COUNT }),
|
||||
loadRandomTopics({ amount: RANDOM_TOPICS_COUNT }),
|
||||
])
|
||||
|
||||
|
|
|
@ -191,7 +191,7 @@ export const loadTopMonthArticles = async (): Promise<void> => {
|
|||
const after = Math.floor(daysago / 1000)
|
||||
const options: LoadShoutsOptions = {
|
||||
filters: {
|
||||
visibility: 'public',
|
||||
published: true,
|
||||
after,
|
||||
},
|
||||
order_by: 'rating_stat',
|
||||
|
@ -206,9 +206,7 @@ const TOP_ARTICLES_COUNT = 10
|
|||
|
||||
export const loadTopArticles = async (): Promise<void> => {
|
||||
const options: LoadShoutsOptions = {
|
||||
filters: {
|
||||
visibility: 'public',
|
||||
},
|
||||
filters: { published: true },
|
||||
order_by: 'rating_stat',
|
||||
limit: TOP_ARTICLES_COUNT,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user