mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
select next/previous unread feed/category when marking all as read (#1558)
This commit is contained in:
@@ -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[] {
|
||||
|
||||
Reference in New Issue
Block a user