mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
Fix tag collapse state not getting updated
This commit is contained in:
parent
97b4c2124c
commit
5919d9273f
1 changed files with 5 additions and 4 deletions
|
@ -1320,17 +1320,18 @@ impl BackendService for Backend {
|
||||||
fn set_tag_collapsed(&self, input: pb::SetTagCollapsedIn) -> BackendResult<pb::Bool> {
|
fn set_tag_collapsed(&self, input: pb::SetTagCollapsedIn) -> BackendResult<pb::Bool> {
|
||||||
self.with_col(|col| {
|
self.with_col(|col| {
|
||||||
let name = &input.name;
|
let name = &input.name;
|
||||||
let tag: Result<Tag> = if let Some(tag) = col.storage.get_tag(name)? {
|
let mut tag = if let Some(tag) = col.storage.get_tag(name)? {
|
||||||
Ok(tag)
|
tag
|
||||||
} else {
|
} else {
|
||||||
// tag is missing, register it
|
// tag is missing, register it
|
||||||
let t = Tag {
|
let t = Tag {
|
||||||
name: name.to_owned(),
|
name: name.to_owned(),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
Ok(col.register_tag(t)?.0)
|
col.register_tag(t)?.0
|
||||||
};
|
};
|
||||||
tag?.config.browser_collapsed = input.collapsed;
|
tag.config.browser_collapsed = input.collapsed;
|
||||||
|
col.update_tag(&tag)?;
|
||||||
Ok(pb::Bool { val: true })
|
Ok(pb::Bool { val: true })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue