perf: dialog text
Some checks are pending
Build-Apk / build (push) Waiting to run

This commit is contained in:
lisonge 2024-08-06 20:03:48 +08:00
parent 40f9debd33
commit 670974c5c3
9 changed files with 11 additions and 9 deletions

View File

@ -81,7 +81,7 @@ fun ActivityLogPage() {
IconButton(onClick = throttle(fn = vm.viewModelScope.launchAsFn { IconButton(onClick = throttle(fn = vm.viewModelScope.launchAsFn {
mainVm.dialogFlow.waitResult( mainVm.dialogFlow.waitResult(
title = "删除记录", title = "删除记录",
text = "是否删除所有界面记录?", text = "确定删除所有界面记录?",
error = true, error = true,
) )
DbSet.activityLogDao.deleteAll() DbSet.activityLogDao.deleteAll()

View File

@ -295,7 +295,8 @@ fun AppItemPage(
vm.viewModelScope.launchTry { vm.viewModelScope.launchTry {
mainVm.dialogFlow.waitResult( mainVm.dialogFlow.waitResult(
title = "删除规则组", title = "删除规则组",
text = "确定删除规则组 ${group.name} ?" text = "确定删除规则组 ${group.name} ?",
error = true,
) )
val newSubsRaw = subsRaw.copy( val newSubsRaw = subsRaw.copy(
apps = subsRaw.apps apps = subsRaw.apps

View File

@ -204,7 +204,7 @@ fun CategoryPage(subsItemId: Long) {
vm.viewModelScope.launchTry { vm.viewModelScope.launchTry {
mainVm.dialogFlow.waitResult( mainVm.dialogFlow.waitResult(
title = "删除类别", title = "删除类别",
text = "是否删除 ${category.name} ?", text = "确定删除 ${category.name} ?",
error = true, error = true,
) )
subsItem?.apply { subsItem?.apply {

View File

@ -126,7 +126,7 @@ fun ClickLogPage() {
IconButton(onClick = throttle(fn = vm.viewModelScope.launchAsFn { IconButton(onClick = throttle(fn = vm.viewModelScope.launchAsFn {
mainVm.dialogFlow.waitResult( mainVm.dialogFlow.waitResult(
title = "删除记录", title = "删除记录",
text = "是否删除所有触发记录?", text = "确定删除所有触发记录?",
error = true, error = true,
) )
DbSet.clickLogDao.deleteAll() DbSet.clickLogDao.deleteAll()

View File

@ -256,7 +256,7 @@ fun GlobalRulePage(subsItemId: Long, focusGroupKey: Int? = null) {
vm.viewModelScope.launchTry { vm.viewModelScope.launchTry {
mainVm.dialogFlow.waitResult( mainVm.dialogFlow.waitResult(
title = "删除规则组", title = "删除规则组",
text = "是否删除 ${group.name} ?", text = "确定删除 ${group.name} ?",
error = true, error = true,
) )
updateSubscription( updateSubscription(

View File

@ -111,7 +111,7 @@ fun SnapshotPage() {
IconButton(onClick = throttle(fn = vm.viewModelScope.launchAsFn(Dispatchers.IO) { IconButton(onClick = throttle(fn = vm.viewModelScope.launchAsFn(Dispatchers.IO) {
context.mainVm.dialogFlow.waitResult( context.mainVm.dialogFlow.waitResult(
title = "删除记录", title = "删除记录",
text = "是否删除全部快照记录?", text = "确定删除全部快照记录?",
error = true, error = true,
) )
snapshots.forEach { s -> snapshots.forEach { s ->

View File

@ -268,7 +268,8 @@ fun SubsPage(
onDelClick = throttle(fn = vm.viewModelScope.launchAsFn { onDelClick = throttle(fn = vm.viewModelScope.launchAsFn {
mainVm.dialogFlow.waitResult( mainVm.dialogFlow.waitResult(
title = "删除规则组", title = "删除规则组",
text = "确定删除 ${appInfoCache[appRaw.id]?.name ?: appRaw.name ?: appRaw.id} 下所有规则组?" text = "确定删除 ${appInfoCache[appRaw.id]?.name ?: appRaw.name ?: appRaw.id} 下所有规则组?",
error = true,
) )
if (subsRaw != null && subsItem != null) { if (subsRaw != null && subsItem != null) {
updateSubscription(subsRaw.copy(apps = subsRaw.apps.filter { a -> a.id != appRaw.id })) updateSubscription(subsRaw.copy(apps = subsRaw.apps.filter { a -> a.id != appRaw.id }))

View File

@ -309,7 +309,7 @@ private fun SubsMenuItem(
vm.viewModelScope.launchTry { vm.viewModelScope.launchTry {
mainVm.dialogFlow.waitResult( mainVm.dialogFlow.waitResult(
title = "删除订阅", title = "删除订阅",
text = "是否删除 ${subscription?.name ?: subItem.id} ?", text = "确定删除 ${subscription?.name ?: subItem.id} ?",
error = true, error = true,
) )
deleteSubscription(subItem.id) deleteSubscription(subItem.id)

View File

@ -216,7 +216,7 @@ fun useSubsManagePage(): ScaffoldExt {
selectedIds selectedIds
} }
if (canDeleteIds.isNotEmpty()) { if (canDeleteIds.isNotEmpty()) {
val text = "是否删除所选 ${canDeleteIds.size} 个订阅?".let { val text = "确定删除所选 ${canDeleteIds.size} 个订阅?".let {
if (selectedIds.contains(LOCAL_SUBS_ID)) "$it\n\n注: 不包含本地订阅" else it if (selectedIds.contains(LOCAL_SUBS_ID)) "$it\n\n注: 不包含本地订阅" else it
} }
IconButton(onClick = vm.viewModelScope.launchAsFn { IconButton(onClick = vm.viewModelScope.launchAsFn {