fix: 清空日志时同步重置首页计数器

clearLogs() 同时归零 sent/filtered/failed 三个累计计数器
版本 1.4.1 → 1.4.2

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-08 10:30:01 +08:00
parent 04090d3929
commit 6c0f7ff081
2 changed files with 9 additions and 3 deletions
+2 -2
View File
@@ -13,8 +13,8 @@ android {
applicationId = "com.a2i.forwarder" applicationId = "com.a2i.forwarder"
minSdk = 34 minSdk = 34
targetSdk = 36 targetSdk = 36
versionCode = 6 versionCode = 7
versionName = "1.4.1" versionName = "1.4.2"
} }
signingConfigs { signingConfigs {
@@ -78,8 +78,14 @@ class LogStore(private val context: Context, scope: CoroutineScope) {
} }
suspend fun clearLogs() { suspend fun clearLogs() {
ds.edit { it.remove(K.LOGS) } ds.edit {
it.remove(K.LOGS)
it[K.SENT] = 0
it[K.FILTERED] = 0
it[K.FAILED] = 0
}
logs.value = emptyList() logs.value = emptyList()
sentCount.value = 0; filteredCount.value = 0; failedCount.value = 0
} }
suspend fun resetCounters() { suspend fun resetCounters() {