There was an error while loading. Please reload this page.
1 parent 29ae69f commit 452b3c4Copy full SHA for 452b3c4
1 file changed
AnkiDroid/src/main/java/com/ichi2/anki/tags/ManageTagsViewModel.kt
@@ -117,8 +117,11 @@ class ManageTagsViewModel : ViewModel() {
117
}
118
val newCollapsed = !node.collapsed
119
withCol { tags.setCollapsed(tag, newCollapsed) }
120
- // re-fetch tree to get updated collapsed state
121
- tagList = flattenTree(withCol { tags.tree() })
+ // Update the in-memory list with the new collapsed state
+ tagList =
122
+ tagList.map {
123
+ if (it.fullTag == tag) it.copy(collapsed = newCollapsed) else it
124
+ }
125
updateState { it.copy(visibleNodes = computeVisibleNodes(it.searchQuery)) }
126
} catch (e: CancellationException) {
127
throw e
0 commit comments