Fix double deleted item
This commit is contained in:
@@ -164,9 +164,10 @@ export function Inner({uri}: {uri: string | undefined}) {
|
|||||||
const item = thread.data.items[i]
|
const item = thread.data.items[i]
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Handle anchor post
|
* Handle anchor post. Need to check only `depth`, since not found or
|
||||||
|
* blocked posts are not `threadPost`s, but still have `depth`.
|
||||||
*/
|
*/
|
||||||
if (item.type === 'threadPost' && item.depth === 0) {
|
if ('depth' in item && item.depth === 0) {
|
||||||
results.push(item)
|
results.push(item)
|
||||||
|
|
||||||
// Recalculate total parents current index.
|
// Recalculate total parents current index.
|
||||||
@@ -179,9 +180,11 @@ export function Inner({uri}: {uri: string | undefined}) {
|
|||||||
*/
|
*/
|
||||||
if (!deferParents) {
|
if (!deferParents) {
|
||||||
const start = i - 1
|
const start = i - 1
|
||||||
const limit = Math.max(0, start - maxParentCount)
|
if (start > 0) {
|
||||||
for (let pi = start; pi >= limit; pi--) {
|
const limit = Math.max(0, start - maxParentCount)
|
||||||
results.unshift(thread.data.items[pi])
|
for (let pi = start; pi >= limit; pi--) {
|
||||||
|
results.unshift(thread.data.items[pi])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user