align rslib get_subnode impl with anki pythonapi find_deck_in_tree, fix nestdeck due counts issue
This commit is contained in:
parent
6b0b3fcd6a
commit
2606a8a489
@ -66,6 +66,7 @@ David Allison <davidallisongithub@gmail.com>
|
||||
Tsung-Han Yu <johan456789@gmail.com>
|
||||
Piotr Kubowicz <piotr.kubowicz@gmail.com>
|
||||
RumovZ <gp5glkw78@relay.firefox.com>
|
||||
Cecini <github.com/cecini>
|
||||
|
||||
********************
|
||||
|
||||
|
@ -175,9 +175,12 @@ fn hide_default_deck(node: &mut DeckTreeNode) {
|
||||
}
|
||||
|
||||
fn get_subnode(top: DeckTreeNode, target: DeckID) -> Option<DeckTreeNode> {
|
||||
if top.deck_id == target.0 {
|
||||
return Some(top);
|
||||
}
|
||||
for child in top.children {
|
||||
if child.deck_id == target.0 {
|
||||
return Some(child);
|
||||
if let Some(node) = get_subnode(child, target) {
|
||||
return Some(node);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user