File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
decompose/src/androidMain/kotlin/com/arkivanov/decompose Expand file tree Collapse file tree 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
5151fun <A , T : Any > A.handleDeepLink (
5252 block : (Uri ? ) -> T ,
5353): T ? where A : Activity , A : SavedStateRegistryOwner {
54- if (restartIfNeeded()) {
54+ val intentData: Uri ? = intent.data
55+
56+ if ((intentData != null ) && restartIfNeeded()) {
5557 return null
5658 }
5759
5860 val savedState: Bundle ? = savedStateRegistry.consumeRestoredStateForKey(key = KEY_SAVED_DEEP_LINK_STATE )
5961 val isDeepLinkHandled = savedState?.getBoolean(KEY_DEEP_LINK_HANDLED ) ? : false
60- val deepLink = intent.data .takeUnless { isDeepLinkHandled }
62+ val deepLink = intentData? .takeUnless { isDeepLinkHandled }
6163
6264 savedStateRegistry.registerSavedStateProvider(key = KEY_SAVED_DEEP_LINK_STATE ) {
6365 bundleOf(KEY_DEEP_LINK_HANDLED to (isDeepLinkHandled || (deepLink != null )))
You can’t perform that action at this time.
0 commit comments