5.2.8-BETA01 potential fix for loading not finishing

This commit is contained in:
tom5079
2022-01-05 20:19:00 +09:00
parent 1f1c782772
commit bd6bc418e6
5 changed files with 30 additions and 30 deletions

View File

@@ -166,7 +166,7 @@ class Pupil : Application() {
instance = this
isDebugBuild = applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE != 0
WebView.setWebContentsDebuggingEnabled(true)
if (isDebugBuild) WebView.setWebContentsDebuggingEnabled(true)
webView = WebView(this).apply {
with (settings) {
@@ -257,11 +257,10 @@ class Pupil : Application() {
try {
Preferences.get<String>("download_folder").also {
if (it.startsWith("content") && Build.VERSION.SDK_INT > 19)
contentResolver.takePersistableUriPermission(
Uri.parse(it),
Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION
)
contentResolver.takePersistableUriPermission(
Uri.parse(it),
Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION
)
if (!FileX(this, it).canWrite())
throw Exception()