Skip to content

Commit f88bb05

Browse files
committed
Align formatting with the other code
1 parent 608cddb commit f88bb05

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManagerImpl.kt

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -102,31 +102,31 @@ class RNCWebViewManagerImpl(private val newArch: Boolean = false) {
102102
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
103103
webView.setImportantForAutofill(View.IMPORTANT_FOR_AUTOFILL_NO);
104104
}
105-
val base64DownloaderRequestFilePermission = { base64: String ->
106-
webView.reactApplicationContext.getNativeModule(RNCWebViewModule::class.java)?.let { module ->
107-
module.setBase64DownloadRequest(base64)
108-
module.grantFileDownloaderPermissions(getDownloadingMessageOrDefault(), getLackPermissionToDownloadMessageOrDefault())
109-
}
110-
Unit
111-
}
112-
webView.addBlobFileDownloaderJavascriptInterface(
113-
downloadingMessage = getDownloadingMessageOrDefault(),
114-
requestFilePermission = base64DownloaderRequestFilePermission,
115-
)
116-
webView.setDownloadListener(DownloadListener { url, userAgent, contentDisposition, mimetype, contentLength ->
117-
if (url.startsWith("data:")) {
118-
Base64FileDownloader.downloadBase64File(
119-
context = context,
120-
base64 = url,
121-
downloadingMessage = getDownloadingMessageOrDefault(),
122-
requestFilePermission = base64DownloaderRequestFilePermission,
123-
)
124-
return@DownloadListener
125-
}
126-
if (url.startsWith("blob:")) {
127-
webView.evaluateJavascriptWithFallback(BlobFileDownloader.getBase64StringFromBlobUrl(url))
128-
return@DownloadListener
129-
}
105+
val base64DownloaderRequestFilePermission = { base64: String ->
106+
webView.reactApplicationContext.getNativeModule(RNCWebViewModule::class.java)?.let { module ->
107+
module.setBase64DownloadRequest(base64)
108+
module.grantFileDownloaderPermissions(getDownloadingMessageOrDefault(), getLackPermissionToDownloadMessageOrDefault())
109+
}
110+
Unit
111+
}
112+
webView.addBlobFileDownloaderJavascriptInterface(
113+
downloadingMessage = getDownloadingMessageOrDefault(),
114+
requestFilePermission = base64DownloaderRequestFilePermission,
115+
)
116+
webView.setDownloadListener(DownloadListener { url, userAgent, contentDisposition, mimetype, contentLength ->
117+
if (url.startsWith("data:")) {
118+
Base64FileDownloader.downloadBase64File(
119+
context = context,
120+
base64 = url,
121+
downloadingMessage = getDownloadingMessageOrDefault(),
122+
requestFilePermission = base64DownloaderRequestFilePermission,
123+
)
124+
return@DownloadListener
125+
}
126+
if (url.startsWith("blob:")) {
127+
webView.evaluateJavascriptWithFallback(BlobFileDownloader.getBase64StringFromBlobUrl(url))
128+
return@DownloadListener
129+
}
130130
webView.setIgnoreErrFailedForThisURL(url)
131131
val module = webView.reactApplicationContext.getNativeModule(RNCWebViewModule::class.java) ?: return@DownloadListener
132132
val request: DownloadManager.Request = try {

0 commit comments

Comments
 (0)