Skip to content

Commit 5c3e867

Browse files
goofyzWhiredPlanck
authored andcommitted
fix: clear previous liquid keyboard data before adding new one
1 parent fc22c80 commit 5c3e867

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

app/src/main/java/com/osfans/trime/ime/symbol/TabManager.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ object TabManager {
4343
}
4444

4545
fun refresh() {
46+
reset()
47+
4648
val available = theme.liquid.getList("keyboards") ?: return
4749
for (item in available) {
4850
val id = item?.configValue?.getString() ?: ""
@@ -54,13 +56,18 @@ object TabManager {
5456
val keys = keyboard["keys"]
5557
addTabHasKeys(name, type, keys)
5658
}
57-
tabSwitchData.clear()
5859
tabSwitchData.addAll(
5960
tabTags.filter { SymbolKeyboardType.hasKeys(it.type) }
6061
.map { SimpleKeyBean(it.text) },
6162
)
6263
}
6364

65+
private fun reset() {
66+
tabTags.clear()
67+
keyboards.clear()
68+
tabSwitchData.clear()
69+
}
70+
6471
private fun addListTab(
6572
name: String,
6673
type: SymbolKeyboardType,

0 commit comments

Comments
 (0)