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
Original file line numberDiff line numberDiff 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 DownExpand Up@@ -74,4 +76,3 @@ data class RowndConfig(
return uriBuilder.build().toString()
}
}

Original file line numberDiff line numberDiff 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 DownExpand 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