Skip to content

Commit

Permalink
refactor: remove redundant codes
Browse files Browse the repository at this point in the history
  • Loading branch information
plateaukao committed Oct 20, 2024
1 parent 27b726b commit e1c3cb7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ android {

lint {
baseline = file("lint-baseline.xml")
//isCheckReleaseBuilds = false
disable.add("MissingTranslation")
checkReleaseBuilds = false
}

namespace = "info.plateaukao.einkbro"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package info.plateaukao.einkbro.browser

import android.app.Activity
import android.util.Log
import android.webkit.JavascriptInterface
import info.plateaukao.einkbro.preference.ConfigManager
import info.plateaukao.einkbro.service.TranslateRepository
import info.plateaukao.einkbro.view.EBWebView
import info.plateaukao.einkbro.view.dialog.DialogManager
import info.plateaukao.einkbro.viewmodel.TRANSLATE_API
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.Dispatchers
Expand All @@ -22,7 +20,6 @@ class JsWebInterface(private val webView: EBWebView) :
KoinComponent {
private val translateRepository: TranslateRepository = TranslateRepository()
private val configManager: ConfigManager by inject()
private val dialogManager: DialogManager by lazy { DialogManager(webView.context as Activity) }

// to control the translation request threshold
private val semaphoreForTranslate = Semaphore(4)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import info.plateaukao.einkbro.caption.DualCaptionProcessor
import info.plateaukao.einkbro.preference.ConfigManager
import info.plateaukao.einkbro.unit.BrowserUnit
import info.plateaukao.einkbro.unit.HelperUnit
import info.plateaukao.einkbro.view.EBWebView
import info.plateaukao.einkbro.view.EBToast
import info.plateaukao.einkbro.view.EBWebView
import info.plateaukao.einkbro.view.dialog.DialogManager
import info.plateaukao.einkbro.view.dialog.compose.AuthenticationDialogFragment
import nl.siegmann.epublib.domain.Book
Expand Down Expand Up @@ -231,6 +231,10 @@ class EBWebViewClient(
request: WebResourceRequest?,
error: WebResourceError?,
) {
// if (request?.isForMainFrame == true) {
// view?.loadUrl("file:///android_asset/trex.html")
// return
// }
// if https is not available, try http
if (error?.description == "net::ERR_SSL_PROTOCOL_ERROR" && request != null) {
ebWebView.loadUrl(request.url.buildUpon().scheme("http").build().toString())
Expand Down

0 comments on commit e1c3cb7

Please sign in to comment.