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 -> { PreferKey.cleanCache -> {
BookHelp.clearCache() BookHelp.clearCache()
requireActivity().cacheDir.listFiles()?.forEach { FileUtils.deleteFile(requireActivity().cacheDir.absolutePath)
it.delete()
}
toast(R.string.clear_cache_success) toast(R.string.clear_cache_success)
} }
PreferKey.defaultCover -> { PreferKey.defaultCover -> {

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