Skip to content

Commit

Permalink
fix: custom scheduling
Browse files Browse the repository at this point in the history
`postBaseUrl` will be necessary until the backend isn't updated.

Reproduction steps:
1. Add some JS to the Deck's custom scheduling. e.g. `console.log("foo")`
2. Open a deck
3. See `ReferenceError` in the console or logcat
  • Loading branch information
BrayanDSO committed May 23, 2024
1 parent 93df55c commit 30e4bfe
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2263,6 +2263,8 @@ abstract class AbstractFlashcardViewer :
override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) {
pageRenderStopwatch.reset()
pageFinishedFired = false
val script = "globalThis.ankidroid = globalThis.ankidroid || {}; ankidroid.postBaseUrl = ``"
view?.evaluateJavascript(script, null)
}

override fun shouldInterceptRequest(
Expand Down

0 comments on commit 30e4bfe

Please sign in to comment.