mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-28 07:26:57 +00:00
修复文章丢失
This commit is contained in:
@@ -3,16 +3,21 @@ export default function getAllPageIds (collectionQuery, collectionId, collection
|
|||||||
if (!collectionQuery && !collectionView) {
|
if (!collectionQuery && !collectionView) {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
let pageIds = []
|
|
||||||
// 优先按照第一个视图排序
|
// 优先按照第一个视图排序
|
||||||
if (viewIds && viewIds.length > 0) {
|
let pageIds = []
|
||||||
const ids = collectionView[viewIds[0]].value.page_sort
|
try {
|
||||||
// console.log('PageIds: 从viewId获取', viewIds)
|
if (viewIds && viewIds.length > 0) {
|
||||||
for (const id of ids) {
|
const ids = collectionQuery[collectionId][viewIds[0]]?.collection_group_results?.blockIds
|
||||||
pageIds.push(id)
|
for (const id of ids) {
|
||||||
|
pageIds.push(id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 否则按照数据库原始排序
|
} catch (error) {
|
||||||
} else if (collectionQuery && Object.values(collectionQuery).length > 0) {
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 否则按照数据库原始排序
|
||||||
|
if (pageIds.length === 0 && collectionQuery && Object.values(collectionQuery).length > 0) {
|
||||||
const pageSet = new Set()
|
const pageSet = new Set()
|
||||||
Object.values(collectionQuery[collectionId]).forEach(view => {
|
Object.values(collectionQuery[collectionId]).forEach(view => {
|
||||||
view?.blockIds?.forEach(id => pageSet.add(id)) // group视图
|
view?.blockIds?.forEach(id => pageSet.add(id)) // group视图
|
||||||
|
|||||||
Reference in New Issue
Block a user