diff --git a/Core2/Compose/Core/src/main/java/com/infomaniak/core2/compose/core/ScreenUtils.kt b/Core2/Compose/Core/src/main/java/com/infomaniak/core2/compose/core/ScreenUtils.kt index 7042599c8..92e5209c5 100644 --- a/Core2/Compose/Core/src/main/java/com/infomaniak/core2/compose/core/ScreenUtils.kt +++ b/Core2/Compose/Core/src/main/java/com/infomaniak/core2/compose/core/ScreenUtils.kt @@ -39,7 +39,7 @@ fun LockScreenOrientation(isLocked: Boolean) { } } -private fun Context.findActivity(): Activity? = when (this) { +private tailrec fun Context.findActivity(): Activity? = when (this) { is Activity -> this is ContextWrapper -> baseContext.findActivity() else -> null