Skip to content

Commit

Permalink
perf: log zip name
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Mar 18, 2024
1 parent da66eca commit 6da00a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
9 changes: 1 addition & 8 deletions app/src/main/kotlin/li/songe/gkd/ui/home/SettingsPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -453,14 +453,7 @@ fun useSettingsPage(): ScaffoldExt {
HorizontalDivider()

SettingItem(title = "分享日志", onClick = {
vm.viewModelScope.launchTry(Dispatchers.IO) {
val logFiles = LogUtils.getLogFiles()
if (logFiles.isNotEmpty()) {
showShareLogDlg = true
} else {
toast("暂无日志")
}
}
showShareLogDlg = true
})
HorizontalDivider()

Expand Down
11 changes: 2 additions & 9 deletions app/src/main/kotlin/li/songe/gkd/util/FolderExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,8 @@ fun initFolder() {


fun buildLogFile(): File {
val files = LogUtils
.getLogFiles()
.toMutableList()
dbFolder
.listFiles { f -> f.isFile }
?.forEach { files.add(it) }
subsFolder
.listFiles { f -> f.isFile }
?.forEach { files.add(it) }
val files = mutableListOf(dbFolder, subsFolder)
LogUtils.getLogFiles().firstOrNull()?.parentFile?.let { files.add(it) }
val appListFile = logZipDir
.resolve("appList.json")
appListFile.writeText(json.encodeToString(appInfoCacheFlow.value.values.toList()))
Expand Down

0 comments on commit 6da00a3

Please sign in to comment.