Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion android/src/main/java/io/rownd/android/models/RowndConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ data class RowndConfig(
var forceInstantUserConversion: Boolean = false,
@Transient
var enableDebugMode: Boolean = false,
@Transient
var enableSmartLinkPasteBehavior: Boolean = true,

// Internals
@Transient
Expand Down Expand Up @@ -74,4 +76,3 @@ data class RowndConfig(
return uriBuilder.build().toString()
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ class SignInLinkApi @Inject constructor() {
@Inject
lateinit var apiClient: KtorApiClient

@Inject
lateinit var config: io.rownd.android.models.RowndConfig

suspend fun createSignInLink() : SignInLink {
return authenticatedApiClient.client.post("me/auth/magic").body()
}
Expand Down Expand Up @@ -129,13 +132,15 @@ class SignInLinkApi @Inject constructor() {

if (action == ACTION_VIEW && isRowndSignInLink(ctx.intent?.data)) {
dispatchSignInWithLink(ctx.intent?.data)
} else if (ctx.hasWindowFocus()) {
// Look on the clipboard
signInWithLinkFromClipboardIfPresent(ctx)
} else {
val rootView = ctx.findViewById<View>(android.R.id.content)
rootView.doOnLayout {
} else if (config.enableSmartLinkPasteBehavior) {
if (ctx.hasWindowFocus()) {
// Look on the clipboard
signInWithLinkFromClipboardIfPresent(ctx)
} else {
val rootView = ctx.findViewById<View>(android.R.id.content)
rootView.doOnLayout {
signInWithLinkFromClipboardIfPresent(ctx)
}
}
}
}
Expand Down