debug-panel , fix sth

This commit is contained in:
tangly1024.com
2023-02-09 12:23:42 +08:00
parent eee01c3085
commit 5f1a13e2a0
7 changed files with 18 additions and 14 deletions

View File

@@ -37,7 +37,9 @@ export function GlobalContextProvider({ children }) {
function switchTheme() {
const currentIndex = ALL_THEME.indexOf(theme)
const newIndex = currentIndex < ALL_THEME.length - 1 ? currentIndex + 1 : 0
changeTheme(ALL_THEME[newIndex])
const newTheme = ALL_THEME[newIndex]
changeTheme(newTheme)
return newTheme
}
function changeTheme(theme) {

View File

@@ -236,8 +236,8 @@ async function getPageRecordMapByNotionAPI({ pageId, from }) {
})
}
const categoryOptions = getAllCategories({ allPages, categoryOptions: getCategoryOptions(schema), sliceCount: BLOG.PREVIEW_CATEGORY_COUNT })
const tagOptions = getAllTags({ allPages, sliceCount: BLOG.PREVIEW_TAG_COUNT, tagOptions: getTagOptions(schema) })
const categoryOptions = getAllCategories({ allPages, categoryOptions: getCategoryOptions(schema) })
const tagOptions = getAllTags({ allPages, tagOptions: getTagOptions(schema) })
const siteInfo = getBlogInfo({ collection, block })
const customNav = getCustomNav({ allPages: collectionData.filter(post => post.type === 'Page' && post.status === 'Published') })
const latestPosts = getLatestPosts({ allPages, from, latestPostCount: 5 })