File tree 1 file changed +4
-2
lines changed
decompose/src/androidMain/kotlin/com/arkivanov/decompose
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -51,13 +51,15 @@ import androidx.savedstate.SavedStateRegistryOwner
51
51
fun <A , T : Any > A.handleDeepLink (
52
52
block : (Uri ? ) -> T ,
53
53
): T ? where A : Activity , A : SavedStateRegistryOwner {
54
- if (restartIfNeeded()) {
54
+ val intentData: Uri ? = intent.data
55
+
56
+ if ((intentData != null ) && restartIfNeeded()) {
55
57
return null
56
58
}
57
59
58
60
val savedState: Bundle ? = savedStateRegistry.consumeRestoredStateForKey(key = KEY_SAVED_DEEP_LINK_STATE )
59
61
val isDeepLinkHandled = savedState?.getBoolean(KEY_DEEP_LINK_HANDLED ) ? : false
60
- val deepLink = intent.data .takeUnless { isDeepLinkHandled }
62
+ val deepLink = intentData? .takeUnless { isDeepLinkHandled }
61
63
62
64
savedStateRegistry.registerSavedStateProvider(key = KEY_SAVED_DEEP_LINK_STATE ) {
63
65
bundleOf(KEY_DEEP_LINK_HANDLED to (isDeepLinkHandled || (deepLink != null )))
You can’t perform that action at this time.
0 commit comments