Skip to content

Commit

Permalink
fix: clear previous liquid keyboard data before adding new one
Browse files Browse the repository at this point in the history
  • Loading branch information
goofyz authored and WhiredPlanck committed Mar 15, 2024
1 parent fc22c80 commit 5c3e867
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/src/main/java/com/osfans/trime/ime/symbol/TabManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ object TabManager {
}

fun refresh() {
reset()

val available = theme.liquid.getList("keyboards") ?: return
for (item in available) {
val id = item?.configValue?.getString() ?: ""
Expand All @@ -54,13 +56,18 @@ object TabManager {
val keys = keyboard["keys"]
addTabHasKeys(name, type, keys)
}
tabSwitchData.clear()
tabSwitchData.addAll(
tabTags.filter { SymbolKeyboardType.hasKeys(it.type) }
.map { SimpleKeyBean(it.text) },
)
}

private fun reset() {
tabTags.clear()
keyboards.clear()
tabSwitchData.clear()
}

private fun addListTab(
name: String,
type: SymbolKeyboardType,
Expand Down

0 comments on commit 5c3e867

Please sign in to comment.