select next/previous unread feed/category when marking all as read (#1558)

This commit is contained in:
Athou
2025-03-04 20:15:11 +01:00
parent 7d744b4ce0
commit d46b571444
32 changed files with 2403 additions and 2078 deletions

View File

@@ -1,11 +1,22 @@
import { throttle } from "throttle-debounce"
import type { Category } from "./types"
export function visitCategoryTree(category: Category, visitor: (category: Category) => void): void {
visitor(category)
for (const child of category.children) {
visitCategoryTree(child, visitor)
export function visitCategoryTree(
category: Category,
visitor: (category: Category) => void,
options?: {
childrenFirst?: boolean
}
): void {
const childrenFirst = options?.childrenFirst
if (!childrenFirst) visitor(category)
for (const child of category.children) {
visitCategoryTree(child, visitor, options)
}
if (childrenFirst) visitor(category)
}
export function flattenCategoryTree(category: Category): Category[] {