Skip to content

Commit

Permalink
Handle undefined links in reader view
Browse files Browse the repository at this point in the history
Also added check to ignore "root" url trailing slash
  • Loading branch information
msasikanth committed Feb 15, 2024
1 parent eeb3d96 commit 86d852e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ private object ReaderJs {
function handleLinkClick(event) {
try {
event.preventDefault();
let href = findHref(event.target);
var href = findHref(event.target);
if (href == undefined || href == "/") {
href = ""
}
window.kmpJsBridge.callNative(
"linkHandler",
href,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ class ReaderLinkHandler(private val openLink: (String) -> Unit) : IJsMessageHand
navigator: WebViewNavigator?,
callback: (String) -> Unit
) {
openLink(message.params)
if (message.params.isNotBlank()) {
openLink(message.params)
}
}

override fun methodName(): String {
Expand Down

0 comments on commit 86d852e

Please sign in to comment.