pull/279/head
gedoor 4 years ago
parent d069221494
commit 10f52f3d2a
  1. 4
      app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt
  2. 6
      app/src/main/java/io/legado/app/ui/main/MainViewModel.kt

@ -80,9 +80,7 @@ class OtherConfigFragment : PreferenceFragmentCompat(),
}
PreferKey.cleanCache -> {
BookHelp.clearCache()
requireActivity().cacheDir.listFiles()?.forEach {
it.delete()
}
FileUtils.deleteFile(requireActivity().cacheDir.absolutePath)
toast(R.string.clear_cache_success)
}
PreferKey.defaultCover -> {

@ -81,11 +81,7 @@ class MainViewModel(application: Application) : BaseViewModel(application) {
fun postLoad() {
execute {
FileUtils.getDirFile(context.cacheDir, "Fonts").let {
if (it.exists()) {
it.delete()
}
}
FileUtils.deleteFile(FileUtils.getPath(context.cacheDir, "Fonts"))
}
}
}
Loading…
Cancel
Save