Skip to content

Commit

Permalink
feat: showSaveSnapshotToast (gkd-kit#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Jul 4, 2024
1 parent 8cdd1b7 commit a6ba66c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/src/main/kotlin/li/songe/gkd/debug/SnapshotExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ object SnapshotExt {
throw RpcError("正在保存快照,不可重复操作")
}
captureLoading.value = true
toast("正在保存快照...")
if (storeFlow.value.showSaveSnapshotToast) {
toast("正在保存快照...")
}

try {
val snapshotDef = coroutineScope { async(Dispatchers.IO) { createComplexSnapshot() } }
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/kotlin/li/songe/gkd/ui/AdvancedPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,16 @@ fun AdvancedPage() {
)
}

TextSwitch(
name = "保存快照提示",
desc = "保存快照时是否提示\"正在保存快照\"",
checked = store.showSaveSnapshotToast
) {
storeFlow.value = store.copy(
showSaveSnapshotToast = it
)
}

Text(
text = "其它",
modifier = Modifier.titleItemPadding(),
Expand Down
1 change: 1 addition & 0 deletions app/src/main/kotlin/li/songe/gkd/util/Store.kt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ data class Store(
val sortType: Int = SortTypeOption.SortByName.value,
val showSystemApp: Boolean = true,
val showHiddenApp: Boolean = false,
val showSaveSnapshotToast: Boolean = true,
)

val storeFlow by lazy {
Expand Down

0 comments on commit a6ba66c

Please sign in to comment.